AD – Add Indiv Users

Attr Used (not in any order):

  • Description
  • displayName
  • homeDirectory
  • homeDrive
  • givenName
  • Mail
  • 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

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s