1. Managing user accounts
1.1 Creating user accounts
one single user by command line
dsadd user "cn=Test User,ou=sales,dc=rspguam-domain,dc=test" -samid testuser -upn testuser@rspguam-domain.test -fn Test -ln User -display "Test User" -pwd P@ssw0rd -disabled no
many users by command line
FOR /L %i in (1,1,10) DO dsadd user "cn=Test User%i,ou=sales,dc=rspguam-domain,dc=test" -samid testuser%i -upn testuser%i@rspguam-domain.test -fn Test -ln User%i -display "Test User%i" -pwd P@ssw0rd -disabled no
many users by batch file
@echo off
cls
echo Creating Accounts
echo -----------------
FOR /L %%I in (10,1,99) DO dsadd user "cn=Test User%%I,ou=sales,dc=rspguam-domain,dc=test" -samid testuser%%I -upn testuser%%I@rspguam-domain.test -fn Test -ln User%%I -display "Test User%%I" -pwd P@asswOrd -disabled no
echo -----------------
pause
1.2 Delete users in a OU
dsrm -noprompt "ou=sales,dc=rspguam-domain,dc=test" -subtree -exclude
1.3 Reset user's password
@echo off
cls
echo Reset Password
echo ---------------
set /p DN=Enter the first and last name of the user in quotes:
dsquery user -name %DN% | dsmod user -pwd NewP@sswOrd -mustchpwd yes
echo ---------------
pause
1.4 Move a user and rename the user
dsmove "cn=Test User10,ou=sales,dc=rspguam-domain,dc=test" -newparent ou=accounting,dc=rspguam-domain,dc=test -newname "Dwight Schrute"
This blog simply records all I've learned for IT knowledge.
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2008
(22)
-
▼
July
(13)
- Configuring windows server 2008 core basic network...
- ways to zero out file
- Remove data from Active Directory when the normal ...
- reading material about smb
- Get a system dump from shell
- Joining linux in windows domain
- a cool video about web 2.0
- Automation in Active Directory
- Install fake printers on Windows 2000
- Compatibility issue when upgrading/downgrading bet...
- Cron
- How to flush DNS
- Installing Second Active Directory Service on Wind...
-
▼
July
(13)
No comments:
Post a Comment