PowerShell Team

I installed Win7 RC build yesterday and tried to enable PS Remoting. I launched PowerShell elevated, ran Enable-PsRemoting cmdlet but it gave an “access denied” error message 

PS C:\Windows\system32> Enable-PSRemoting -force
WinRM already is set up to receive requests on this machine.
Set-WSManQuickConfig : Access is denied.
At line:50 char:33
+             Set-WSManQuickConfig <<<<  -force
    + CategoryInfo          : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand

One good thing in PowerShell help in RC is “about_Remote_Troubleshooting”. It is very detailed and covers all important failure scenarios. Go through it if you face problem with enabling remoting on a box

To summarize, there are few things that I had to check

1.      My machine is connected to domain.

2.      I am logged in as administrator

3.      PowerShell is launched elevated.

4.      My password is not blank

Problem was that my domain a/c was not an administrator on the box. Even if I launch PowerShell elevated (and give local administrator creds) it was not working. I tried logging in as local admin but Enable-PS Remoting still failed.

Solution: I had to add my domain a/c to administrators group and Enable-PsSession worked after that.

 If you are not an administrator, Enable-PsSession will fail even if you launch elevated. This is true for some other remoting configuration cmdlets as well e.g.

 Set-PSSessionConfiguration Microsoft.Powershell -ShowSecurityDescriptorUI

Another important thing to know is – “You must run PowerShell elevated if you’re connecting to the same box (localhost)”.

Osama Sajid




Discussion is closed.

Feedback usabilla icon