wisem2540 Posted July 29, 2014 Share Posted July 29, 2014 I see there is a Active Directory UDF and I see that Water is working on enhancements. I would like to do something very simple Prompt for a username, and password in a specific group. If it passes authentication, great, if not, then exit. But I do not understand where to start. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 29, 2014 Moderators Share Posted July 29, 2014 What are you trying to do with the authentication attempt (Open a file/dir, log into a remote machine, etc.)? Prompting for the username and password can be done easily enough with either a couple of InputBoxes or a small GUI, but the twist will come in what you're trying to accomplish (keeping in mind, as well, whatever lockout policies your domain has in place). "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
wisem2540 Posted July 29, 2014 Author Share Posted July 29, 2014 Scenarios: Member of Group and Bad Password = Error message and exit Good Password Not Memeber of Group = Error about group and exit Good Password, Good Group - Continue Script Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 29, 2014 Moderators Share Posted July 29, 2014 I'm not sure what enhancements Water is working on, but I have used this in the past to test for authentication. Again, be mindful of your corporate lockout policies. pwCheck("Jim-Bob", "Password1", "myCompany.com") Func pwCheck($Name, $Password, $Domain) Const $ADS_SECURE_AUTHENTICATION = 1 $oAD = ObjGet("WinNT:").OpenDSObject("WinNT://" & $Domain, $Name, $Password, $ADS_SECURE_AUTHENTICATION) MsgBox(0, $Domain & "\" & $name, @error) EndFunc "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
wisem2540 Posted July 29, 2014 Author Share Posted July 29, 2014 (edited) That works just fine. I looked up the command, and I do not see a way for it to support group memberships Edited July 29, 2014 by wisem2540 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 29, 2014 Moderators Share Posted July 29, 2014 You would need to combine it with another function, such as _AD_IsMemberOf. I would suggest this (pseudo): declare your vars (domain, username, pw, group) call a single function passing those vars Execute _AD_IsMemberOf first (if this fails, no need to test authentication and potentially lock the account) If successful, move on to the next item. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted July 29, 2014 Share Posted July 29, 2014 JLogan3o13 provided the perfect solution! As I'm not working on any enhancements for the AD UDF at the moment there is only one way to check the userid/password. Pass the credentials to _AD_Open. With the enhanced error checking you can tell that the user provided a invalid passwort or whatever. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
wisem2540 Posted July 29, 2014 Author Share Posted July 29, 2014 (edited) Thanks for the feedback guys. After looking over the UDFs, this is more trouble than its worth. Most UDFs are just one au3 file with several functions. The AD zip I downloaded had 86 AU3 files in it. One for every function. I can simply create a password and code it into the app. Edited July 29, 2014 by wisem2540 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 29, 2014 Moderators Share Posted July 29, 2014 JLogan3o13 provided the perfect solution! As I'm not working on any enhancements for the AD UDF at the moment there is only one way to check the userid/password. Pass the credentials to _AD_Open. With the enhanced error checking you can tell that the user provided a invalid passwort or whatever. Geez, should have thought of that. So much more simple "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted July 29, 2014 Share Posted July 29, 2014 Most UDFs are just one au3 file with several functions. The AD zip I downloaded had 86 AU3 files in it. One for every function. You only need AD.au3 in your script! All other files are example scripts, help files etc. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
wisem2540 Posted July 31, 2014 Author Share Posted July 31, 2014 Water, Thanks, I actually just noticed that this morning, and have since gotten AD Authetincation working! I wanted to stop by and thank everyone for their help again. Link to comment Share on other sites More sharing options...
water Posted July 31, 2014 Share Posted July 31, 2014 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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