Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
March 20, 2006
I have scripted DomUsrPwd.bat to set a domain user's password, using the LDAP provider.
The syntax for using DomUsrPwd.bat is:
Call DomUsrPwd UserDN PassPhrase
Where:
UserDN is the user's distinguished name, like "CN=Jordan Valley,CN=Users,DC=JSIINC,DC=COM".PassPhrase is the new password, like "My 3 dogs are very BIG!".
DomUsrPwd.bat contains:
@echo offif {%2}=={} @echo Syntax: DomUsrPwd UserDN PassPhrase&goto :EOFif exist "%TEMP%DomUsrPwd.vbs" goto :doit@echo Dim oArgs, strUserDN, strNewPasswd>"%TEMP%DomUsrPwd.vbs"@echo Set oArgs = WScript.Arguments>>"%TEMP%DomUsrPwd.vbs"@echo strUserDN = oArgs(0)>>"%TEMP%DomUsrPwd.vbs"@echo strNewPasswd = oArgs(1)>>"%TEMP%DomUsrPwd.vbs"@echo Set objUser = GetObject("LDAP://" ^& strUserDN)>>"%TEMP%DomUsrPwd.vbs"@echo objUser.SetPassword(strNewPasswd)>>"%TEMP%DomUsrPwd.vbs":doitcscript //nologo "%TEMP%DomUsrPwd.vbs" %1 %2
You May Also Like