Install and Configure Windows PowerShell

Applies to: Office 365 for professionals and small businesses, Office 365 for enterprises, Live@edu

Before you can use Windows PowerShell, make sure you have the correct versions of Windows PowerShell and Windows Remote Management (WinRM) installed and configured on your computer. You have to use the Windows Management Framework, which contains the correct versions of Windows PowerShell v2 and WinRM 2.0.

If your computer is running Windows 7 or Windows Server 2008 R2, you don't have to install anything. The Windows Management Framework is already installed.

You can download and install the Windows Management Framework if your computer is running one of the following operating systems:

  • Windows Vista Service Pack 1 (SP1) or SP2
  • Windows Server 2008 SP1 or SP2
  • Windows Server 2003 SP2
  • Windows XP SP3

Let's get started:

  1. Uninstall previous versions of Windows PowerShell from your computer.
  2. Uninstall previous versions of WinRM from your computer.
  3. Install the Windows Management Framework.
  4. Verify that Windows PowerShell can run scripts.
  5. Verify that WinRM allows Windows PowerShell to connect.

1. Uninstall previous versions of Windows PowerShell from your computer

Before you can install the Windows Management Framework, you have to uninstall any existing versions of Windows PowerShell.

Note   This step isn't required for Windows 7 or Windows Server 2008 R2.

Uninstall Windows PowerShell from Windows Vista

  1. In Control Panel, in Programs, open Programs and Features, and uninstall any instances of Windows PowerShell that appear in the installed programs list. For example, the Community Technology Preview (CTP) version of Windows PowerShell v2 may appear as Windows PowerShell (TM) V2.
  2. Under Tasks, select View installed updates and uninstall any instances of Windows PowerShell that appear in the installed updates list. For example, Windows PowerShell V1 may appear as a Windows update with one of the following Microsoft Knowledge Base article numbers:
    • KB928439
    • KB923569

Uninstall Windows PowerShell from Windows Server 2008

  1. Start Server Manager and go to Features.
    1. Click Uninstall Features.
    2. Select Windows PowerShell and follow the directions to uninstall.
  2. In Control Panel, in Programs, open Programs and Features, and uninstall any instances of Windows PowerShell that appear in the installed programs list.
  3. Under Tasks, select View installed updates. Uninstall any instances of Windows PowerShell that appear in the installed updates list.

Top of page

Uninstall Windows PowerShell from Windows Server 2003 and Windows XP

  1. In Control Panel, open Add or Remove Programs, and uninstall any instances of Windows PowerShell that appear in the installed programs list.
  2. In Add or Remove Programs, select Show updates. Uninstall any instances of Windows PowerShell that appear in the installed updates list. For example, Windows PowerShell V1 may appear as a Windows update with the Knowledge Base article number KB926139.

Top of page

2. Uninstall previous versions of WinRM from your computer

Before you can install the Windows Management Framework, you must uninstall any existing versions of WinRM.

Note   This step isn't required for Windows 7 or Windows Server 2008 R2.

Uninstall WinRM from Windows Vista or Windows Server 2008

  1. In Control Panel, in Programs, open Programs and Features, and uninstall any instances of Windows Remote Management that appear in the installed programs list.
  2. Under Tasks, select View installed updates. Uninstall any instances of Windows Remote Management that appear in the installed updates list. For example, the Community Technology Preview (CTP) of WinRM 2.0 may appear as WindowsRemoteManagement with one of the following Knowledge Base article numbers:
    • KB936059
    • KB950099

Uninstall Windows PowerShell from Windows Server 2003 and Windows XP

  1. In Control Panel, open Add or Remove Programs, and uninstall any instances of Windows Remote Management that appear in the installed programs list.
  2. In Add or Remove Programs, select Show updates. Uninstall any instances of Windows Remote Management that appear in the installed updates list. For example, WinRM might appear as a Windows update with the Knowledge Base article number KB936059.

Top of page

3. Install the Windows Management Framework

  • Download and install the Windows Management Framework. Choose the package that includes Windows PowerShell v2 and WinRM 2.0, and that applies to your operating system, system architecture, and language.
    After you install WinRM and Windows PowerShell, configure the software to work correctly as described in the next steps.
    Note   If your local computer is protected by a Microsoft Internet Security and Acceleration (ISA) server, you may have to install the Windows Firewall Client or configure a proxy server on your local computer to connect Windows PowerShell to the cloud-based service. For more information, see Windows PowerShell: FAQs for Administrators.

Top of page

4. Verify that Windows PowerShell can run scripts

  1. Click Start > All Programs > Accessories > Windows PowerShell.

  2. Do one of the following to open Windows PowerShell:

    • If you're running Windows Vista, Windows 7, or Windows Server 2008 R2, right-click Windows PowerShell and select Run as administrator. If you get a user account control prompt that asks if you would like to continue, respond Continue.
    • If you're running Windows XP or Windows Server 2003, click Windows PowerShell.
  3. Run the following command:

    Get-ExecutionPolicy
    
  4. If the value returned is anything other than RemoteSigned, you need to change the value to RemoteSigned.
    Note   When you set the script execution policy to RemoteSigned, you can only run scripts that you create on your computer or scripts that are signed by a trusted source.

Enable scripts to run in Windows PowerShell

In Windows PowerShell session you just opened as an administrator, run the following command:

Set-ExecutionPolicy RemoteSigned

Top of page

5. Verify that WinRM allows Windows PowerShell to connect

  1. Click Start > All Programs > Accessories.

  2. Do one of the following to open a command prompt:

    • If you're running Windows Vista, Windows 7, or Windows Server 2008 R2, right-click Command Prompt and select Run as administrator. If you get a user account control prompt that asks if you would like to continue, respond Continue.
    • If you're running Windows XP or Windows Server 2003, click Command Prompt.
  3. At the command prompt, run the following commands:

    net start winrm
    winrm get winrm/config/client/auth
    

    Note   If the WinRM service is already running, you don't have to start it. You can check the status of the WinRM service by running the command sc query winrm.

  4. In the results, look for the value Basic = . If the value is Basic = false, you must change the value to Basic = true.
    Note   If you started the WinRM service, and you don't need to change the Basic value, run the command net stop winrm to stop the WinRM service.

Configure WinRM to support basic authentication

  1. At the command prompt you just opened as an administrator, run the following commands. The value between the braces { } is case-sensitive:

    winrm set winrm/config/client/auth @{Basic="true"}
    
  2. In the command output, verify the value Basic = true.
    Note   If you started the WinRM service, run the command net stop winrm to stop the WinRM service.

Top of page

Next step