Tuesday, February 11, 2014

Importing and Running Exchange 2010 cmdlets in Windows PowerShell

There might be times when you don't have the Exchange Management tools installed on the workstation or server that you are currently working from. With a few commands, you can import an Exchange session into Windows PowerShell and go on about your Exchange management.

Connecting to a remote Exchange session

First, you'll need to connect using your admin credentials:

Fire up Windows PowerShell, and run:

$Credentials = Get-Credential

You will receive a prompt for you to input your username/password for the session.


Creating the Remote Exchange Session

To create an Exchange session using Kerberos, run:

$ExSession = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri ‘http://Exchservername.yourdomain.com/PowerShell/?SerializationLevel=Full’ -Credential $Credentials –Authentication Kerberos

**Note** Change "exchangeservername.domain.com" to your Exchange server

Importing the Remote Session

To import the Exchange cmdlets, run:

Import-PSSession $ExSession

After the session is imported, you can carry on with Exchange management.

Ending the Remote Session 


When you're done, to remove the session, run:

Remove-PSSession $ExSession

No comments:

Post a Comment