Skip to content

Instantly share code, notes, and snippets.

@nitincoded
Created January 3, 2017 06:19
Show Gist options
  • Save nitincoded/4965006a6a6f734aa4c6332875f66e2b to your computer and use it in GitHub Desktop.
Save nitincoded/4965006a6a6f734aa4c6332875f66e2b to your computer and use it in GitHub Desktop.
PowerShell script for new user and mailbox
$newuserpass=ConvertTo-SecureString "ablublah" -AsPlainText -Force
New-ADUser -Name "fname.lname" -GivenName "fname" -Surname "lname" -DisplayName "fname lname" -AccountPassword $newuserpass -Path "OU=subgroup,DC=dcname,DC=dcupname" -Enabled 1
#On Exchange Server
Enable-Mailbox -Identity fname.lname -Database MBOX01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment