One of the interesting things in the Exchange 2007 is the introduction of PowerShell into the management of Exchange. PowerShell is a very powerful tool that the Exchange administrator now has in their arsenal. Many regular, advanced and or mundane tasks can now be automated with PowerShell scripts or commands.
Matthew — “To help demonstrate what we can do with PowerShell, and get you the administrator interested in writing your own scripts, I hope to start posting a series of scripts (as I am able to write them) to the EHLO blog. The intent is that these scripts will solve a problem that you the Exchange administrators are having and will work as a way to teach PowerShell scripting thru example. “
The first script I have for you is to solve a problem I have seen coming in on the phones here at Microsoft a few times. As our customers are migrating from Exchange 2003 to Exchange 2007 they are finding that some of the aliases of their contacts, users, or distributions groups contain invalid characters. If there are only a few it is simple to modify them by hand, but in many cases there are 10s if not hundreds that are incorrect.
With PowerShell and .net we can write a script that will correct this issue easily for us. Now most of the documentation of the script is in the comments sections of the script itself; but, I am going to go over the script flow and a few key things that I use in my script writing.