Export (0) Print
Expand All

Connect to Exchange Using Remote Shell

 

Applies to: Exchange Server 2013

Topic Last Modified: 2012-12-10

The Exchange Management Shell is the administrative interface that enables you to manage your Microsoft Exchange Server 2013 organization from the command line. If you don't have the Exchange management tools installed, but you still want to connect to and administer an Exchange 2013 organization, this topic explains how you can create a manual remote Shell to connect to, or disconnect from, an Exchange 2013 server.

noteNote:
For ease of management and to receive the benefits that come with them, we recommend that you install the Exchange management tools on any computer that's used to administer an Exchange 2013 server. For more information, see Install the Exchange 2013 Management Tools and Open the Shell.

For more information about the Exchange Management Shell, see Exchange Management Shell.

For additional management tasks related to the Shell, see Manage Exchange Management Shell Access.

  • Microsoft .NET Framework 4.5 must be installed on the computer you want to use to connect to an Exchange server. For more information, see Installing the .NET Framework 4.5.
    noteNote:
    Windows Server 2012 and Windows 8 include .NET Framework 4.5. You must install .NET Framework 4.5 on Windows 7 Service Pack 1 (SP1) and Windows Server 2008 R2 SP1.
  • Windows Management Framework 3.0 must be installed on the computer you want to use to connect to an Exchange server. To download Windows Management Framework 3.0, see Windows Management Framework 3.0.
    noteNote:
    Windows Management Framework 3.0 includes Windows PowerShell V3 and Windows Remote Management (WinRM) 3.0. Windows Server 2012 and Windows 8 include Windows Management Framework 3.0. You must install Windows Management Framework 3.0 on Windows 7 Service Pack 1 (SP1) and Windows Server 2008 R2 SP1.
  • The computer you use to connect an Exchange server must be running one of the following operating systems:
    • Windows Server 2012
    • Windows Server 2008 R2 SP1
    • Windows 8
    • Windows 7 SP1
  • The fully qualified domain name (FQDN) of an Exchange 2013 server in your organization.
  • TCP port 80 must be open between your client computer and the remote Exchange 2013 server.
  • The user account you use to connect to the remote Exchange server must be enabled for remote Shell. For more information, see Manage Exchange Management Shell Access.
  • The user account must be a member of a management role group or be directly assigned a management role that enables the user to run Exchange cmdlets. For more information about role groups and management roles, see Permissions.
  • You must use the Shell to perform these procedures.
  • Windows PowerShell script execution must be enabled on the computer you want to use to connect to an Exchange server. To enable script execution for signed scripts, run the following command in an elevated Windows PowerShell window.
    Set-ExecutionPolicy RemoteSigned
    
  • For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard Shortcuts in the Exchange Admin Center.
tipTip:
Having problems? Ask for help in the Exchange forums. Visit the forums at: Exchange Server, Exchange Online, or Exchange Online Protection

When you connect to a remote Exchange server, you can use your current network credentials or you can specify another set of credentials.

importantImportant:
After you’re finished with your remote Shell connection, be sure to disconnect from the Exchange server. For more information, see the “Disconnect from a remote Exchange server” section later in this topic.

  1. Open Windows PowerShell.
  2. Open the connection to Exchange 2013 by running the following command. You must specify the fully qualified domain name (FQDN) of an Exchange 2013 Client Access server.
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange 2013 Client Access server>/PowerShell/ -Authentication Kerberos
    
  3. Import the server-side PowerShell session into your client-side session by running the following command.
    Import-PSSession $Session
    

  1. Open Windows PowerShell.
  2. Enter your network credentials and store them in a variable by running the following command.
    $UserCredential = Get-Credential
    
  3. In the dialog box, type the user name and password of the administrator account that has access to administer the Exchange 2013 server you want to connect to, and then click OK.
  4. Open the connection to Exchange 2013 by running the following command. You must specify the FQDN of an Exchange 2013 Client Access server.
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange 2013 Client Access server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
    
  5. Import the server-side PowerShell session into your client-side session by running the following command.
    Import-PSSession $Session
    

Use the following command to disconnect remote Shell from an Exchange 2013 server.

Remove-PSSession $Session
 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft