Skip to content

PowerShell: configuring WinRm if execution policy disabled

June 25, 2015

By default PowerShell is configured to not allow to execute PowerShell scripts on Windows systems. But sometimes one needs to execute script without having local administrator rights.

The most common way is to allow script execution by the following command:

Set-ExecutionPolicy RemoteSigned

To bypass this policy you need to create PowerShell script file, e.g. runme.ps1 and execute in the following way:

Get-Content .\runme.ps1 | Invoke-Expression
WinRm configuration script:
winrm quickconfig -quiet
winrm set winrm/config/Client/Auth '@{Basic="true"}'
winrm set winrm/config/Service/Auth '@{Basic="true"}'
winrm set winrm/config/Service '@{AllowUnencrypted="true"}'
Advertisements

From → PowerShell

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: