Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to run any cmdlet on Windows Server 2012 not under Administrator account?

$
0
0

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 as
administrator" 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.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>