Bulk Mailbox Provisioning with Random Passwords – Easy PowerShell tricks for Exchange Server 2010
Bulk Mailbox Provisioning with Random Passwords – Easy PowerShell tricks for Exchange Server 2010
In a recent Exchange 2010 class here at Interface, we had a discussion on the topic of provisioning mailboxes with PowerShell. One of the questions that came up is how would you go about creating a bulk mailbox provisioning script that would generate an initial secure random password for each mailbox. As it turns out, this is fairly easy to do with a few PowerShell tricks.
I've written a script for this that will create mailboxes in bulk using a CSV file. After the mailboxes have been created, a report is generated that contains the details for each mailbox, along with the associated password. You can download the script here; the steps on how to use it are outlined below.
To use this script, you need to create a CSV file that will be used to create the mailboxes. The column headers in the CSV file should map to the New-Mailbox cmdlet parameter names you would normally use when creating a mailbox. For this example, I am going to use the following parameters and add them as columns in the CSV; Name, Alias, UserPrincipalName, Database and OrganizationalUnit. Obviously, I won't need to provide a password column as the script will handle that part.
Each field will contain the input value for each parameter. You can create the file in excel and save it in CSV format. Here's a screenshot of the CSV file (saved as c:\users.csv) I am going to use for this example:
The script accepts three parameters; PasswordLength, NonAlphanumericCharacters, and ReportFile. The PasswordLength and NonAlphanumericCharacters parameters are optional parameters. The default password length is set to 8 characters, and the default number of non alpha numeric characters is set to 0. You can override these values as needed to meet your AD password policy requirements. The ReportFile parameter is required and should be the full path to where you want the report to be saved.
Once your CSV file is setup, use the following syntax to create the mailboxes in bulk:
[PS] C:\>.\BulkAddRandom.ps1 -CSVFile c:\users.csv -ReportFile c:\report.csv
After the script is run, open the report file saved to the ReportFile directory to view the password assigned to each mailbox:
Now you can use the report to distribute the passwords to the new users.
Enjoy!
Mike Pfeiffer – Microsoft MVP
Interface Technical Training – Director of Unified Communications
Training courses Mike teaches in Phoenix, AZ and online with RemoteLive™
Exchange Server Training – EXCH2010: Designing and Implementing Exchange Server 2010
PowerShell Training – PS350EX: PowerShell for Exchange Server
Microsoft Lync Server Training – 10533: Deploying Configuring and Administering Lync Server 2010
Video Training Courses by Mike Pfeiffer:
Exchange Server Course Video – EXCH2010 Designing and Implementing Microsoft Exchange Server 2010
PowerShell Course Video – PS350EX: PowerShell for Exchange Server
You May Also Like
A Simple Introduction to Cisco CML2
0 3698 0Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2
How to use the PowerShell ConvertFrom- CSV Cmdlet to Save Coding Time with PS Script
0 322 4In this video, PowerShell instructor Jason Yoder shows how to use the ConvertFrom-CSV PowerShell Cmdlet to easily convert standard CSV files into PowerShell objects and speed up coding time. For instructor-led PowerShell training classes, see our course schedule: Microsoft Windows PowerShell Training PowerShell ConvertFrom-CSV script used in this video. Download ConvertFrom-CSV PowerShell Script <# ╔══════════════════════════════════════════════════════════════════════════════╗ … Continue reading How to use the PowerShell ConvertFrom- CSV Cmdlet to Save Coding Time with PS Script
Configuring Windows Mobility Center and How to Turn it On and Off
1 1411 1Video transcription Steve Fullmer: In our Windows training courses, we often share information about the Windows 8.1 Mobility Center. Mobility Center was introduced for mobile and laptop devices in Windows 7. It’s present and somewhat enhanced in Windows 8. Since we don’t have mobile devices in our classrooms, I decided to take a little bit … Continue reading Configuring Windows Mobility Center and How to Turn it On and Off