How to connect to your managed environment by using Windows Remote PowerShell in Office 365 dedicated

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.
  1. 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:
    1. Type the following cmdlet in Windows Remote PowerShell, and then press Enter:
      $cred = Get-Credential
    2. 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.
  2. 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:
    $session = New-PSSession -Authentication basic -Credential $cred -ConnectionUri https://mail.contoso.com/PowerShell/ -ConfigurationName Microsoft.Exchange
    The following table describes the parameters for the new session and their values.

    ParameterValueDescription
    -AuthenticationbasicThis sets the authentication mode in the new session to basic.
    -Credential$credThe new session calls the $cred variable that is created in step 1. That variable contains the credentials that you entered previously.
    -ConnectionUrihttps://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.
    -ConfigurationNameMicrosoft.ExchangeThis configures the new Windows PowerShell.
  3. Import the remote session that is stored in the $session variable. To do this, run the following cmdlet in Windows PowerShell:
    Import-PSSession $session
 You can also combine three steps into one script. To do this, run the following cmdlet in Windows PowerShell::

Import-PSSession (New-PSSession -Authentication basic -Credential (Get-Credential) -ConnectionUri https://mail.contoso.com/powershell -ConfigurationName Microsoft.Exchange)

Properties

Article ID: 2792291 - Last Review: 01/15/2016 09:06:00 - Revision: 4.0

Microsoft Business Productivity Online Dedicated, Microsoft Business Productivity Online Suite Federal

  • vkbportal226 KB2792291
Feedback