Adding a user to multiple distribution lists via Outlook can be a tedious process if many lists are involved. For today’s problem, I had to add a user to many lists that have a similar prefix. Instead of spending a an hour or more of adding the user to the DLs through the Global Address Book, I decided to use PowerShell.
This script, which I call “addtodl.ps1”, receives three parameters: the user’s email address, the name of the distribution list – which can include a wildcard character (*) to get multiple names, and the Exchange Server FQDN.
By running this at the PowerShell command line with the parameters, you will be able to add the user to all distribution lists in the query that you manage. Those that you do not have access to will cause an error that will not halt the script. A dialog box asking for your username and password will appear first.
When I have time, I intend to revisit this issue to get more useful information such as owner email addresses. Currently, if you uncomment the lines inside the foreach statement, the owners of each DL will be printed on the screen as well. It’s not too useful yet – which is why I still have it commented here.
PowerShell is a very powerful tool for Windows administrators and developers alike.
I wanted to find out if a particular user ID was in the local admin group on all servers in my domain. Fortunately, someone had written a script (source link no longer exists) to check that very thing on the server you’re logged onto.
However, I wanted to check not just the server I’m on, but on all servers in the domain.
The script below, called findadmins.ps1, should do just that:
When upgrading an Active Directory Domain Controller from Windows Server 2008 (or 2008 R2) to Windows Server 2012, the AD Forest must be upgraded first. This has to be manually done, as it is not part of the setup process.
To upgrade the AD Forest, right-click on the Command Prompt icon and select “Run as Administrator”. Insert the Windows Server 2012 DVD (or mount the ISO using a virtual drive) and switch to that drive inside Command Prompt: “cd [Drive letter]: <ENTER>“.
At the command prompt, type “[Drive letter]:supportadprep /forestprep <ENTER>“. You will be given a warning about how this is not a reversible operation. Type “C” and hit <ENTER> to continue. Once this is done, type “[Drive letter]:supportadprep /domainprep <ENTER>“.
After this step is complete, you may proceed with the upgrade to Windows Server 2012.