by lunarg on September 15th 2015, at 15:56

Rather than installing the Exchange 2013 management tools, you could also connect to the Exchange Management Shell (EMS) through Powershell "remoting".

Connect to EMS using the current credentials (i.e. the user running Powershell):

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchange-server-fqdn/PowerShell -Authentication Kerberos

Import-PSSession $session

Replace exchange-server-fqdn with the FQDN or IP address of the Exchange server you wish to connect to. With this command, you will be using the credentials of the current logged in user, and authenticate through Kerberos. If the user is not a organizational admin, you will be able to log in but won't be able to change any configuration and only have access to a limited number of data (e.g. Get-Mailbox would only return the user's mailbox data).

To connect to the EMS using other credentials is also possible:

$creds = Get-Credential

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchange-server-fqdn/PowerShell -Authentication Kerberos -Credential $creds

Import-PSSession $session

This will prompt you to enter credentials and connect to EMS with them. This allows you to log in as another user (e.g. organization or domain admin) and you will then be able to run all cmdlets allowed for that user.

Once connected, all cmdlets you run will be run on the Exchange-server. This allows you to perform any task that you would normally run when logged on to EMS directly on the server. Note that all file manipulations are done locally and not remotely. Running dir or outputting to a file will be done locally.

When you're done, exiting Powershell will automatically close the connection. If you want to close the session and return to the local Powershell environment, run:

Remove-PSSesion $session
« April 2024»
« You only find out who is swimming naked when the tide goes out. »
Warren Buffett