How to set ExecutionPolicy: access to registry key denied

Posted by jrara on Server Fault See other posts from Server Fault or by jrara
Published on 2010-03-24T06:25:43Z Indexed on 2010/03/24 6:33 UTC
Read the original article Hit count: 1414

I'm running Windows Server 2008 as admin and I tried to set ExecutionPolicy as Remotesigned for PowerShell v2 like this:

Set-ExecutionPolicy RemoteSigned

But I got this error:

Set-ExecutionPolicy : Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft
.PowerShell' is denied.
At line:1 char:20
+ Set-ExecutionPolicy <<<<  RemoteSigned
    + CategoryInfo          : NotSpecified: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyComma
   nd

How to fix this?

© Server Fault or respective owner

Related posts about windows-server-2008

Related posts about powershell