Article ID: 2411920 - View products that this article applies to.
Expand all | Collapse all

PROBLEM

When you try to run a script in Windows Azure Active Directory Module for Windows PowerShell, you receive one of the following error messages:
File C:\my_script.ps1 cannot be loaded. The execution of scripts is disabled on this system. Please see "Get-Help about_signing" for more details.
File C:\Desktop\myscript.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
File C:\my_script.ps1 cannot be loaded. The file C:\my_script.ps1 is not digitally signed. The script will not execute on the system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.

CAUSE

This issue may occur if the execution policy is set to Restricted. Certain Windows PowerShell cmdlets can't run if the policy is too restricted.

SOLUTION

To resolve this issue, follow these steps:
  1. Run the Windows Azure Active Directory Module for Windows PowerShell as an admin. To do this, click Start, click All Programs, click Windows Azure Active Directory, right-click Windows Azure Active Directory Module for Windows PowerShell, and then click Run as administrator.
  2. Set the execution policy to Unrestricted. To do this, type the following cmdlet, and then press Enter:
    Set-ExecutionPolicy Unrestricted
  3. Run the Windows PowerShell cmdlets that you want.
  4. Set the execution policy to Restricted. To do this, type the following cmdlet, and then press Enter:
    Set-ExecutionPolicy Restricted

MORE INFORMATION

To help deliver a more secure command-line administration experience, Windows PowerShell uses "execution policies" to control how Windows PowerShell can be used. Execution policies define the restrictions under which Windows PowerShell loads files for execution and configuration. By default, Windows PowerShell runs in the Restricted execution policy. This mode is its most secure mode in which Windows PowerShell operates as an interactive shell only.

The four execution policies are as follows:
  • Restricted is the default execution policy. This policy doesn't run scripts and is interactive only.
  • AllSigned policy runs scripts. All scripts and configuration files must be signed by a publisher that you trust. This policy opens you to the risk of running signed but malicious scripts, after you confirm that you trust the publisher.
  • RemoteSigned policy runs scripts. All scripts and configuration files that are downloaded from communication applications such as Microsoft Outlook, Windows Internet Explorer, Outlook Express, and Windows Messenger must be signed by a publisher that you trust. This policy opens you to the risk of running malicious scripts that are not downloaded from these applications, and you are not prompted.
  • Unrestricted policy runs scripts. All scripts and configuration files that are downloaded from communication applications such as Outlook, Internet Explorer, Outlook Express, and Windows Messenger run after you confirm that you understand that the file originated from the Internet. No digital signature is required. This policy opens you to the risk of running unsigned, malicious scripts that are downloaded from these applications.

Still need help? Go to the Office 365 Community website or the Windows Azure Active Directory Forums website.

Properties

Article ID: 2411920 - Last Review: October 31, 2013 - Revision: 22.0
Applies to
  • Windows Azure
  • Microsoft Office 365
  • Microsoft Office 365 for enterprises (pre-upgrade)
  • Microsoft Office 365 for education  (pre-upgrade)
  • Microsoft Office 365 for small businesses  (pre-upgrade)
  • CRM Online via Office 365 E Plans
  • Windows Azure Recovery Services
Keywords: 
o365 o365a o365e o365062011 pre-upgrade o365m o365p o365022013 after upgrade KB2411920

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com