|
|
Set 'Change Password' Flag in ADJuly 20, 2004
Author: Eugenio Talarico Description: Set 'change password' flag in Active Directory. If you specify:
0 Select USER MUST CHANGE PWD -1 Deselect USER MUST CHANGE PWD. Batch structure: for /f "tokens=1-2 delims=;" %%a in (input.txt) do ( cscript r_ch_pwd.vbs %%a %%b) into the input.txt put: username;-1 You have to specify where the TARGET OBJECT IS CONTAINED into the VBS script. Scroll down to view the script. ''***************************************************************************** ''* INTO STRVARIABL LINE PUT THE PATH WHERE THE OBJECT TARGET IS CONTAINED ''***************************************************************************** ''***************************************************************************** strVariabl = "OU=pippo,OU=pluto" ''***************************************************************************** ''***************************************************************************** ''***************************************************************************** By Eugenio Script Code: dim nome dim param ParseCommandLine() Const ADS_PROPERTY_APPEND = 3 Set objRootDSE = GetObject("LDAP://rootDSE") ''***************************************************************************** ''* INTO STRVARIABL LINE PUT THE PATH WHERE THE OBJECT TARGET IS CONTAINED ''***************************************************************************** ''***************************************************************************** strVariabl = "OU=pippo,OU=pluto" ''***************************************************************************** ''***************************************************************************** ''***************************************************************************** strFissa = strVariabl & "," & objRootDSE.Get("defaultNamingContext") Set objUser = GetObject _ ("LDAP://cn="& nome & "," & strFissa) objUser.Put "pwdLastSet", param objUser.SetInfo Sub ParseCommandLine() Dim vArgs set vArgs = WScript.Arguments if vArgs.Count <> 2 then DisplayUsage() Else nome = vArgs(0) param = vargs(1) End if End Sub Disclaimer: We hope that the information in these pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided "as - is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by me. I shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.
|
Access FREE HP ProCurve Tools: | ||
Whitepaper:
ProCurve ProActive Defense Empowers Your Business with More Security and Less Complexity Whitepaper: Extending the Enterprise Network Through Mobility Whitepaper: Convergence--Preparing the Enterprise Network Video: ProCurve Networking by HP |
|