On a side note I have this to create a user (mostly from Dan's article). Does anyone know if I need to create them this way before I create mailboxes or does the mailbox thing create the user as well?
$domain = [ADSI] "LDAP://TESTSERVER:389/dc=test,dc=local"
$TestAccounts = [ADSI] "LDAP://OU=Test Accounts,DC=test,DC=local"
$newUser = $TestAccounts.Create("user","cn=Test User")
$newUser.put("title", "Powershell Created User")
$newUser.put("Description", "Test Descr")
$newUser.put("givenName", "TestGivenName")
$newUser.put("sn", "TestSuName")
$newUser.put("Department", "Sales")
$newUser.put("userPrincipalName", "Account01@test.local")
$newUser.put("sAMAccountName", "Account01")
$newUser.put("userPassword", "Password1")
$newUser.SetInfo()
$newUser.put("useraccountcontrol",$newUser.useraccountcontrol.value -band (-bnot 2))
$newUser.SetInfo()
EDIT: The password seems to be blank rather than the one I set though.
cheers
Andy