Symptoms
You cannot connect to your managed environment by using Windows Remote PowerShell in Microsoft Office 365 dedicated.
Cause
This issue occurs if one or more of the following conditions are true:
- Prerequisites are not met.
- You use the incorrect Windows Remote PowerShell cmdlet.
- Windows Remote PowerShell is configured incorrectly in your environment.
Resolution
To resolve this issue, use one of the following methods, as appropriate for your situation.
When you connect to a remote Microsoft Exchange 2010 server, you should specify a username and password as credentials to authenticate the session. To do this, follow these steps.
Note These credentials should be the current domain\username and password. However, they do not have to be the credentials that you use to log on to your computer.
- Declare a variable that is named $cred, and then set the value for the variable to the results of the Get-Credential prompt (your username and password). To do this, follow these steps:
- Type the following cmdlet in Windows Remote PowerShell, and then press Enter:
$cred = Get-Credential
- When the Get-Credential cmdlet prompts you for credentials, type the credentials that you use to authenticate the remote Exchange 2010 server. The credentials that you type are stored in the $cred variable.
- Type the following cmdlet in Windows Remote PowerShell, and then press Enter:
- Declare a variable that is named $session, and then set the value for the variable to a new Windows PowerShell remote session. To do this, run the following cmdlet in Windows Remote PowerShell:The following table describes the parameters for the new session and their values.
$session = New-PSSession -Authentication basic -Credential $cred -ConnectionUri https://mail.contoso.com/PowerShell/ -ConfigurationName Microsoft.Exchange
Parameter Value Description -Authentication basic This sets the authentication mode in the new session to basic. -Credential $cred The new session calls the $cred variable that is created in step 1. That variable contains the credentials that you entered previously. -ConnectionUri https://mail.contoso.com/PowerShell/ This provides the fully qualified domain name (FQDN) for the Remote PowerShell connection by using HTTPS. You should replace mail.contoso.com with your company’s Outlook Web App (OWA) domain. -ConfigurationName Microsoft.Exchange This configures the new Windows PowerShell. - Import the remote session that is stored in the $session variable. To do this, run the following cmdlet in Windows PowerShell:
Import-PSSession $session
Import-PSSession (New-PSSession -Authentication basic -Credential (Get-Credential) -ConnectionUri https://mail.contoso.com/powershell -ConfigurationName Microsoft.Exchange)