Add/Edit Users via Command Line Windows 2000/2003/2008
Filed under: Active Directory
Comments: None
ADD USER
dsadd user “CN=F/L Name,OU=OUNAME,DC=Domain,DC=com” samid USERNAME -ln Last Name -fn First Name -upn “User@domain.com”
ADD PASSWORD/ENABLE ACCNT
dsmod user “CN=F/L Name,OU=OUNAME,DC=Domain,DC=com” -pwd p@ssword1 -disabled no
CHANGE DESCRIPTION
dsmod user “CN=F/L Name,UO=OUNAME,DC=Domain,DC=com” -pwd p@ssword1 -disabled no -desc “NOTHING”
Delete User
dsrm “CN=F/L Name,UO=OUNAME,DC=Domain,DC=com”
dsrm OBJECT NAME
Add User and Password/Enable accnt with Description
dsadd user “CN=F/L Name,OU=OUNAME,DC=Domain,DC=com” samid USERNAME -ln Last Name -fn First Name -upn “User@domain.com” -pwd p@ssword1 -disabled no
——————————————
dsmod user “CN=F/L Name,UO=OUNAME,DC=Domain,DC=com” -……
——————–
Commands/switches
DSmod DN INFO
DSadd DN INFO
-samid SAMNAME
-upn Universal Prnicipal Name
-fn First Name
-ln Last Name
-display Display name
-empid Employee ID
-pwd Password | *
-desc “Text” Description
-tel 666-5555 telephone Number
-email test@test.com Email address
-title “Text”
-profile //win2k3server/profile/%username%
-hmdir //win2k3server/home/%username%
-hmdrv Z:
-pwdneverexpires yes/no
-acctexpires #ofDays
-disabled Yes/No
Specify Domain Controller wich DSadd.exe will run and the un/pw to use
-s Server | -d Domain
-u Username
-p Password
————————————-
ANOTHER EXAMPLE
dsadd user “CN=Poop Stick,OU=Sales,DC=win2k3,DC=dredsdomain,DC=com” -sa
mid pstick -upn pstick@win2k3.dredsdomain.com -fn Poop -ln Stick -display POOPOO
-empid 666 -pwd password -desc “poopoo on a stick” -office none -tel 6665555 -e
mail poop@hotmail.com -title “head poopie” -dept owner -disabled no -s win2k3ser
ver -u administrator -p ******
dsadd succeeded:CN=Poop Stick,OU=Sales,DC=win2k3,DC=dredsdomain,DC=com