While working on setting up my test Exchange 2007 setup, I got a requirement to create 100 users in my environment. I know how to do it with Vbscript but creating mailbox enabled users increases the complexity of script a bit. Then I explored PowerShell and came up with below piece of code. It might help you too… 🙂
[PS] C:>$password = Read-Host “Enter the password” -AsStringString
[PS] C:>foreach ($number in 1..100) { new-mailbox -name user$number -Alias user$number -database “MBX1SG1S1” -organizationalUnit “SPDOMAIN.COM/INDIA/Users” -UserPrincipalName user$number@spdomain.com -Displayname User$number -password $password }
Please note that, the password will be applied for all 100 test accounts we are creating. Above code creates 100 test user accounts with mailbox enabled on MBX1
SG1S1″ store.
Happy Learning..,
Sitaram Pamarthi