Showing posts with label Active directory. Show all posts
Showing posts with label Active directory. Show all posts

Sunday, 27 September 2009

Disable a user account using command line

Access your domain contoller and type the following format to disable your user :

dsmod user "cn=Joe Bloggs, ou=IT Admins, dc= Your Domain name , dc=com" -disabled yes

Check if user account is active using command line

Access your domain contoller and type the following format to check if the user is active :

NET USER jbloggs /DOMAIN | FIND /I "Account active"

Delete a user in Active Directory using command line

Access your domain contoller and type the following format to delete your user :

dsrm "cn=Joe Bloggs, ou=IT Admins, dc= Your Domain name , dc=com"

Add a user in Active Directory using command line

Access your domain contoller and type the following format to add your user :

dsadd user "cn=Joe Bloggs, ou=IT Admins, dc= Your Domain name , dc=com" -samid joebloggs -upn info@YourDomain.com -fn Joe -ln Bloggs -display "Joe Bloggs" -pwd Pa$$w0rd -desc "Systems Administrator"

*ou = is the name of Organisational Unit you will be adding the user to.