Attr Used (not in any order):
- Description
- displayName
- homeDirectory
- homeDrive
- givenName
- sAMAccountName
- sn
- scriptPath
- userPrincipalName
Script:
$objOU=[ADSI]”LDAP://<OU DN>”
$objUser=$objOU.Create(“user”,”CN=Test One”)
$objUser.Put(“sAMAccountName”,”TOne”)
$objUser.Put(“givenName”,”Test”)
$objUser.Put(“sn”,”One”)
$objUser.Put(“Description”,”<descr>”)
$objUser.Put(“displayName”,”Test One”)
$objUser.Put(“homeDirectory”,”<users share folder>”)
$objUser.Put(“homeDrive”,”<Drive letter>”)
$objUser.Put(“mail”,”<e-mail address>”)
$objUser.Put(“scriptPath”,”<script for adding personal drives>”)
$objUser.Put(“userPrincipalName”,”<user name>@<full domain name>”)
$objUser.SetInfo()
$objUser | Get-Member