Here is the VBScript code I use to verify user's password. CONST ADS_SCOPE_SUBTREE = 2 CONST ADS_SECURE_AUTHENTICATION = &H0001 CONST ADS_SERVER_BIND = &H0200 Set objContainer = GetObject("LDAP:") If DebugMode = True then msgbox ("Created LDAP object") ' Set USername and Password strPassword = oEnvironment.Item("UserPassword") strUsername = oEnvironment.Item("UserDomain") & "\" & oEnvironment.Item("UserID") ' Bind to the root of the directory using previously entered credentials err.clear
strADSPath = "LDAP://myDCaddress.edu/dc=mysubdomain,dc=mydomain,dc=edu" on error resume next If DebugMode = True then msgbox ("Querying lDAP") Set adsMyObject = objContainer.OpenDSObject (strADsPath, strUsername, strPassword, ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND) if err.number = 0 then PasswordOK = TRUE If DebugMode = True then MSGBOX ("Password verified") else MSGBOX ("You have entered an invalid password. Error= " & err.number) err.clear End If From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Mark Mears Sent: Thursday, November 07, 2013 2:05 PM To: mssms@lists.myitforum.com Subject: RE: [mssms] HTA program for add a user in Local administrator group Sounds like an idea for an Orchestrator runbook activity! Thanks, ________________________________ Mark Mears mark.me...@cireson.com<mailto:mark.me...@cireson.com%0d> Phone: (757) 945-2651 [cid:image001.png@01CEAC8E.61A72300]<http://www.cireson.com/> [cid:image002.jpg@01CEAC8E.61A72300]<http://twitter.com/teamcireson> Check out our System Center App Store: www.cireson.com/app-store ________________________________ From: listsad...@lists.myitforum.com<mailto:listsad...@lists.myitforum.com> [mailto:listsad...@lists.myitforum.com] On Behalf Of Rajan K Sent: Thursday, November 7, 2013 2:34 PM To: mssms@lists.myitforum.com<mailto:mssms@lists.myitforum.com> Subject: [mssms] HTA program for add a user in Local administrator group Hi, I need a HTA program for password validation and add an user in Local administrator group using SCCM 2007 RAP. Any ideal? ========================================================================== <HTML> <HEAD><TITLE>Password Validation</TITLE> <SCRIPT LANGUAGE="VBScript"> <!-- Sub Submit_OnClick Dim TheForm Dim password Set TheForm = Document.ValidForm If TheForm.Text1.Value = "password" Then MsgBox "access granted" Else MsgBox "access denied" `Current user need to be added in local administrator/ prompt for user input. End If End Sub Sub RunProgram Set oShell = CreateObject("WScript.Shell") oShell.Run _"NET.EXE LOCALGROUP /ADD Administrators ""NT Authority\Interactive""" _, 0, True End Sub --> </SCRIPT> </HEAD> <BODY> <H3>Password Validation</H3><HR> <FORM NAME="ValidForm"> Enter your password: <INPUT NAME="Text1" TYPE="TEXT" SIZE="10"> <INPUT NAME="Submit" TYPE="BUTTON" VALUE="Submit"> </FORM> </BODY> </HTML> ========================================================================================== Regards Rajan ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________
<<inline: image001.png>>
<<inline: image002.jpg>>