Windows Powershell for Office 365 Error “cannot be loaded because the execution of scripts is disabled on this system…”

I wanted to repost this great info from http://www.java-samples.com/sho
wtutorial.php?tutorialid=1558 because it was hard to find.

When running the command “Import-PSSession $Session” it would return the error message below.

…cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details. then follow these steps to resolve it.

To resolve this, first check the current policy and then change it to unrestricted.

1. Check policy with the command:

Get-ExecutionPolicy

2. If it returns “Restricted”, then change it to unrestricted with the command

Set-Executionpolicy -ExecutionPolicy Unrestricted

3. Boom, works now.

Advertisements

6 thoughts on “Windows Powershell for Office 365 Error “cannot be loaded because the execution of scripts is disabled on this system…”

  1. Nick says:

    Hmmm.

    I tried:

    Set-Executionpolicy -ExecutionPolicy RemoteSigned

    when working on a local Exchange 2010 instance. I’d recommend trying that first as best practice.

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