Had a good one recently on a newly built server whilst trying to get PowerShell WinRM working with a local admin user, here's the scenerio:

 Enter-PSSession -ComputerName servername -Port 81 -cred servername\localusername  
 [servername]: Import-Module webadministration   
Process should have elevated status to access IIS configuration data.

When running this as a local admin account I receive the error "Process should have elevated status to access IIS configuration data.", yet if I use my domain account which is also in the admin group on the server in question then everything works!  How weird...

Anyway the problem lies in the Remote User Account Control (UAC) settings in the registry, here's the fix (taken from http://support.microsoft.com/kb/942817):

  1. Run regedit
  2. Locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system
  3. On the Edit menu, point to New, and then click DWORD Value.
  4. Type LocalAccountTokenFilterPolicy for the name of the DWORD, and then press ENTER.
  5. Right-click LocalAccountTokenFilterPolicy, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Exit Registry Editor.

or in Powershell:

new-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -propertyType DWord -Name "LocalAccountTokenFilterPolicy" -Value 1

 

This setting will take effect straight away so no reboot required.

 

 


Posted in: PowerShell  Tags: ,

Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Calendar

«  May 2012  »
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
View posts in large calendar

Recent Comments

Banners

Theme Grabber
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 Dan Gibbons .Net Developer