Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevinblumenfeld/834ace8d0c6bdf37feec8afaf82116bc to your computer and use it in GitHub Desktop.
Save kevinblumenfeld/834ace8d0c6bdf37feec8afaf82116bc to your computer and use it in GitHub Desktop.
$i = 1
while (get-aduser -LDAPfilter "(userprincipalname=$userprincipalname)") {
$FirstName = $FirstName + $i
$userprincipalname = $LastName.replace(" ", "") + "-" + $FirstName.replace(" ", "") + "@" + $PsBoundParameters[$ParamName_emaildomain]
$i++
}
$name = $LastName + ", " + $FirstName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment