Dear friends,
When I run the following script or similar on w2k12:
Get-PSSessionConfiguration
I'm getting an error:
Get-PSSessionConfiguration : Access is denied. To run this cmdlet, start Windows PowerShell with the "Run asadministrator" option.
At line:1 char:1
+ Get-PSSessionConfiguration
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-PSSessionConfiguration], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.GetPSSessionConfiguration
Command
When I open powershell console using "Run as administrator" everything works fine.
On w2k3 and w2k8 I had the same problem, it was solved performing: Set-ExecutionPolicy Unrestricted; in both PowerShell versions x86 and x64. Then I could run any script under any account.
By now Set-ExecutionPolicy Unrestricted; doesn't solve this problem any more on w2k12. I need to run scripts not under Administrator account. BTW my account belongs to BUILTIN\Administrators group but seems it doesn't helps
Have I missed something? Please help me if you know how to solve this problem.