Monday, March 11, 2013

script-CHGPassword

dsquery

dsquery user OU=TestOU,DC=test,DC=int
dsmod user "CN=test01,CN=Users,DC=test,DC=int" -pwd A1b2C3d4 -mustchpwd yes

dsquery to dsmod

dsquery user OU=TestOU,DC=test,DC=int | dsmod  user -pwd A1b2C3d4 -mustchpwd yes

Password file
for /f “eol= tokens=1 delims=” %i in (c:\users.txt) do dsmod user “%i” –pwd <password> -mustchpwd yes –pwdneverexpires no

for /f “eol= tokens=1 delims=” %i in (c:\users.txt) do echo "%i"

for /F "tokens=1,2,* delims=, " %i IN (c:\user.txt) DO @echo user is %i passsword %j

for /F "tokens=1,2,* delims=, " %i IN (c:\tko.cvs) DO @echo user is %i passsword %j



Changepasswd by text file (delimeter,)

for /F "tokens=1,2,* delims=, " %i IN (c:\user.txt) DO dsquery user OU=TestOU,DC=test,DC=int -samid %i | dsmod user CN=%i,OU=TestOU,DC=test,DC=int -pwd %j -mustchpwd yes

for /F "tokens=1,2 delims=," %i IN (c:\user.txt) DO dsquery user OU=TestOU,DC=test,DC=int -samid %i | dsmod user -pwd %j -mustchpwd yes -pwdneverexpires no

for /F "tokens=1,2 delims=," %i IN (c:\user.txt) DO dsquery user OU=TestOU,DC=test,DC=int -samid %i | dsmod user -pwdneverexpires yes

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout