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):
- Run regedit
- Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system
- On the Edit menu, point to New, and then click DWORD Value.
- Type LocalAccountTokenFilterPolicy for the name of the DWORD, and then press ENTER.
- Right-click LocalAccountTokenFilterPolicy, and then click Modify.
- In the Value data box, type 1, and then click OK.
- 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.
0b872f83-8ac0-4d24-98b2-6eddfa1f5b68|0|.0