Microsoft have taken a new approach with Exchange Management Console (EMC) for Microsoft Exchange Server 2010. Unlike Exchange 2007 (to a certain extent), almost every single management task is either a PowerShell command, or a front-end to a PowerShell command. Let’s say, for example, you want to create a new Mailbox. Easy, you say: Recipient Configuration, Mailbox, New Mailbox. Fill in the blanks and hit Next, right? This is great if you want to just create one or two users, but what if, like me, you need to create several hundred in one go? This could get tedious.
Any Exchange 2010 messaging administrator knows of this little gem tucked away in the corner of nearly every options window. Clicking this little icon in the bottom left corner will show you the PowerShell command(s) that EMC is about to execute.
Many, however, are not aware of another tool which is (in my opinion) even more useful. On the ‘View’ menu there is an option to View Exchange Management Shell Command Log…
This little treasure allows you to view any and all PowerShell queries previously run by the Exchange Management Console (in this session). This is very useful if you (like me) spend many hours writing email reports and similar in PowerShell, spending most of your time guessing the queries. Simply open a dialog or screen, hit refresh if necessary (For example, Recipient Mailboxes needs refreshing occasionally), then open the Exchange Management Shell Command Log and scroll to the bottom.
From here you can paste (or retype, or modify, the list goes on) this command into Exchange Management Shell or into your .ps1 scripts. I hope this helps you gain more insight into what is a very powerful tool, and that you can save yourself some time by doing what all of us lazy messaging admins do – write scripts!
There's no commenting functionality here. If you'd like to comment, please either mention me (@email@example.com) on Mastodon or email me. I don't have any logging or analytics running on this website, so if you found something useful or interesting it would mean a lot to hear from you.