wking10 Posted June 30, 2008 Share Posted June 30, 2008 Hi, is there anyway we can script autoit to prompt domain user name and password and check it against active directory? thanks, Link to comment Share on other sites More sharing options...
LarryDalooza Posted June 30, 2008 Share Posted June 30, 2008 port this...http://support.microsoft.com/kb/180548or try using RunAsWait with the credentials and check for success.Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
Developers Jos Posted June 30, 2008 Developers Share Posted June 30, 2008 (edited) Something like this should do it: (i have posted it a few times before) $oMyError = ObjEvent("AutoIt.Error", "ComError") msgbox(0,"Validate",UserValidate(@LogonDomain,"unknown-user","userpwd")) msgbox(0,"Validate",UserValidate(@LogonDomain,"Okuser","userpwd")) msgbox(0,"Validate",UserValidate(@LogonDomain,"Okuser","userpwd","groupdoesnotexist")) msgbox(0,"Validate",UserValidate(@LogonDomain,"Okuser","userpwd","groupexist")) Exit ; Check Valid User/Password and optionally in a group Func UserValidate($domain, $UserName, $Password, $InGroup="") Local $NameSpace = ObjGet("WinNT:") Local $ADS_SECURE_AUTHENTICATION = 0x0001 ; Check the userid/password combination and on error return a 0 Local $DomObj = $NameSpace.OpenDSObject("WinNT://" & $domain , $UserName, $Password, $ADS_SECURE_AUTHENTICATION) If @error <> 0 Then Return 0 ; Optionally check the group membership If $InGroup <> "" Then $objUser = ObjGet("WinNT://" & $Domain & "/" & $UserName) For $oGroup in $objUser.Groups If $oGroup.Name = $InGroup Then Return 1 EndIf Next Return 0 EndIf Return 1 EndFunc ;COM Error function Func ComError() If IsObj($oMyError) Then $HexNumber = Hex($oMyError.number, 8) SetError($HexNumber) Else SetError(1) EndIf Return 0 EndFunc ;==>ComError Edited June 30, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
wking10 Posted July 1, 2008 Author Share Posted July 1, 2008 hi Jos, fantastic! thanks heaps! thats exactly what i need. thanks again. Link to comment Share on other sites More sharing options...
EndFunc Posted February 13, 2009 Share Posted February 13, 2009 This looks pretty good, but is there an example of how to call these functions? EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 13, 2009 Developers Share Posted February 13, 2009 This looks pretty good, but is there an example of how to call these functions?Huh ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
LarryDalooza Posted February 13, 2009 Share Posted February 13, 2009 This looks pretty good, but is there an example of how to call these functions?What a terrible oversight... You are right... I searched the forum and found a nice example here...http://www.autoitscript.com/forum/index.ph...st&p=543969Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
JRowe Posted February 13, 2009 Share Posted February 13, 2009 (edited) Yeah, omg Larry and Jos, way to drop the ball, guys. What were you thinking?! Edited February 13, 2009 by JRowe [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
EndFunc Posted February 13, 2009 Share Posted February 13, 2009 Well what I was asking was not really on an example script which I did see, but a purpose. It returns a 1 or a 0 so I was seeing how this could be useful. I guess I was just wanting to see if anyone used it in a particular way other than just what the OP asked for.Ok this is not a dumb question. As I was testing it with different things, since it uses the domain policy it will lock you out after so many tries. Anyway to say how many times you have tried to autheticate? So if you have input boxes and you've tried twice. You can put, this is your 3rd or 4th attempt?Thanks EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
SolidSnake26 Posted August 17, 2009 Share Posted August 17, 2009 I was looking for it for long I'll give it a try. Thanks Link to comment Share on other sites More sharing options...
BinaryBrother Posted August 17, 2009 Share Posted August 17, 2009 @EndFunc Every time that a login is attempted... +1 to a variable... TryLogin() $LoginAttempts += 1 MsgBox(0,"Attempts", "Login Attempts: " & $LoginAttempts) SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now