View PowerShell commands ran by Exchange Management Console

Here is a quick tip on how you can do to view the commands that Exchange Management Console runs in the background when you do changes using EMC. EMC is basically just a GUI that runs PowerShell commands in the background to execute the changes we make in the GUI.

There are two ways of displaying these PowerShell commands.

The Show Exchange Management Shell Command button

This button is very useful and easy to find. It is located in the bottom-left corner of the dialog boxes used to reveal and set properties on Exchange objects.

ps

When you click this button a window opens, showing the Windows PowerShell command that Exchange will execute when you click OK or Apply. Again, you can use this button to view the commands BEFORE you actually apply the changes.

 

Exchange Management Shell Command Log

Another tool new to the EMC in Exchange 2010 is the Exchange Management Shell Command  Log. It records all shell commands that you run in EMC. You can use this tool to log commands, view then and also export them to a CSV file.

To view the Exchange Management Command Log by right-clicking an object
such as Mailbox in the left pane of EMC and then clicking View and selecting View Exchange
Management Log.

image

I the lower pane you can see and copy the commands, this is an excellent way of getting help and tips when creating PowerShell commands and scripts.

image

Thanks for reading!

Advertisements