I was just asked to take a look at writing a script for our new Exchange environment. Now I do not have a lot of experiance scripting for Exchange but I love a Powershell challenge. The problem was that all of our distribution groups had been set up with one option incorrect. I was asked if I could script a change for all groups. If not then this would take days, perhaps weeks to fix by clicking on every group and changing the option and saving.
I logged into the exchange server and started tooling around. I found that I could get a list of all the groups by doing a simple get-distribution group command as follows:
get-distributiongroup | select name
This gave me the names of all groups. I sent that to a flat file to use later. I then used the get-member command to find the option that I needed to modify. Then I was able to do a set-distributiongroup “name of group” -proertyname 0. That command made the modification that we needed. After verifying that I wrote a foreach loop and I was done in less than 30 minutes. When I called our IT director back and let him know that it was complete he was shocked and very happy. Powershell can make you look very good to upper managment.
Let me know if you have anything that you need a script for.