Active Directory Command Line Tools
There are different ways to add, edit, move or remove users (or objects) in Active Directory. This page lists some older, but still relative command line tools to do so. Please note that PowerShell has more funtionality, but if you only need a few simple functions, these will work as well and are simpler to use.
| Tool | Functie | Voorbeeld |
|---|---|---|
dsadd | Add objects | dsadd user "CN=Jan Jansen,OU=Users,DC=example,DC=com" -samid jjansen -pwd P@ssw0rd123 -memberof "CN=Domain Admins,CN=Users,DC=example,DC=com" |
dsmod | Edit object | dsmod user "CN=Jan Jansen,OU=Users,DC=example,DC=com" -dept "IT" -title "Engineer" |
dsquery | Search objects | dsquery user -name "Jan*" |
dsmove | Move or rename objects | dsmove "CN=Jan Jansen,OU=Users,DC=example,DC=com" -newparent "OU=Managers,DC=example,DC=com" |
csvde | Import/Export CSV | Export: csvde -f export.csv -r "(objectClass=user)" Import: csvde -i -f import.csv |
ldifde | Import/Export LDIF | Export: ldifde -f export.ldf -d "DC=example,DC=com" -p subtree Import: ldifde -i -f import.ldf |