Thursday, February 28, 2013

Create new users and Exchange 2010 mailboxes in PowerShell

Using a .csv as a data source, you can quickly populate your Active Directory with users and make mailboxes for them at the same time. The script below can be used as a quick way to get started with this.



Thursday, February 14, 2013

Scripting UPN suffix changes in PowerShell

I've been doing a little consulting work on the side lately. One client is using an alternate UPN suffix to make a "pretty" UPN even though they're using a subdomain for their Active Directory as I recommend here. Since the end users will be instructed to "log in with their email address" it's important that all user accounts have the proper UPN set.

After defining the desired UPN in Active Directory Domains and Trusts, I realized that there was no good way to "force" new accounts use this UPN. The person at the site responsible for adding and removing users generally isn't a full-time IT person, so while you can give instructions, you can't guarantee that they'll be followed. To work around this, I whipped up a few lines of PowerShell and dropped it into task scheduler. It runs every 10 minutes and queries AD for all users in a specific OU structure that have the undesirable UPN and changes it to the desired one.




Tuesday, February 5, 2013

Creating User Accounts and Copying Existing Group Membership with PowerShell

The script in this post will get you started in using PowerShell scripts to automate your user account creation. It has very basic functionality so far. It takes the username as input from the user. It also asks if you'd like to copy the group membership of an existing user. It then creates a new user in the default container with the appropriate group membership.