After you have installed and configured Windows PowerShell and Windows Remote Management (WinRM) on your computer, you have to connect the Windows PowerShell on your local computer to Outlook Live to perform tasks in your Outlook Live organization.
When you open Windows PowerShell on your computer, you're in the Windows PowerShell session of your local computer. A session is an instance of Windows PowerShell that contains all the commands that are available to you.
The Windows PowerShell session of your local computer, called the client-side session, only has the basic Windows PowerShell commands available to it. By connecting to Outlook Live, you connect to the Outlook Live server environment, called the server-side session, which contains the Outlook Live commands.
Connect Windows PowerShell on your local computer to Outlook Live
-
Click Start > All Programs > Accessories > Windows PowerShell > Windows PowerShell.
-
Run the following command:
$LiveCred = Get-Credential
-
In the Windows PowerShell Credential Request window that opens, type the Windows Live ID and password of an Outlook Live account. When you are finished, click OK.
-
Run the following command:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Note The AllowRedirection parameter enables Outlook Live organizations all over the world to connect Windows PowerShell to Outlook Live by using the same URL.
-
Run the following command:
Import-PSSession $Session
A progress indicator appears that shows the importing of Outlook Live commands into the client-side session of your local computer. When this process is complete, you can run Outlook Live commands.
Disconnect Windows PowerShell from Outlook Live
When you're finished using the Outlook Live server-side session, always disconnect Windows PowerShell from Outlook Live by running the following command:
Remove-PSSession <Outlook Live session variable>
For example, to disconnect from the server-side session that is defined by the $Session variable, run the following command:
Remove-PSSession $Session
Important If you close the Windows PowerShell window without disconnecting from the server-side session, your connection to Outlook Live will remain open for 15 minutes. Your account can only have three connections to the server-side session at one time.
Need help for specific tasks?