Connect to a remote Exchange server 2013 with PowerShell

Xavier Mustin

Administrator
Staff member
#1
  1. Open Windows PowerShell and choose to run as administrator
  2. Run
    Code:
    Set-ExecutionPolicy RemoteSigned
  3. Select Yes
  4. On your local computer, open Windows PowerShell and run the following command.
    Code:
    $UserCredential = Get-Credential
    In the Windows PowerShell Credential Request dialog box, type your Exchange user name and password, and then click OK.

  5. Run the following command. You need to specify the FQDN of an Exchange 2013 Client Access server.
    Code:
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange 2013 Client Access server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
  6. Run the following command.
    Code:
    Import-PSSession $Session
Be sure to disconnect the remote PowerShell session when you're finished. If you close the Windows PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you'll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command.
Code:
Remove-PSSession $Session
 
Last edited:
Haut