gypsy Posted July 5, 2015 Share Posted July 5, 2015 Help. I have a very simple script (below) to query Active Directory to get a User's Groups. My problem is that the script works on Windows 7 64-bit just fine, but when I run the same script on a Windows 7 32-bit I get the following error in the msg box: _AD_Open Result: 0, error: 4, extended: -2147023541In reading the comments in AD.au3, an error code of 4 on _AD_Open means that Creation of the RootDSE object failed. Both these VMs (virtual machines are in the same domain and connected to the same Active Directory. The code that works on the Windows 7 64-bit machine, I've compiled as a 32-bit exe and I still get the same error message. Using AutoIT v3.3.12.0 and AD_1.4.0.0Any thoughts? #include <AD.au3>#include <array.au3>$User = @UserName$R = _ad_Open()MsgBox(0, "", "_AD_Open Result: " & $R & ", error: " & @error & ", extended: " & @extended)Dim $aGroups$aGroups=_AD_GetUserGroups($User) _ad_Close()_ArrayDisplay($aGroups, "AD User Groups")Sleep(2000)Exit Link to comment Share on other sites More sharing options...
water Posted July 5, 2015 Share Posted July 5, 2015 I once had a problem where I could not start the program from a specific directory. a Windows security feature prevented it.Copy the exe to another drive/directory (C:\local etc.) and try again. 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...
gypsy Posted July 5, 2015 Author Share Posted July 5, 2015 Water,Thanks for the suggestion. I tried it and it still doesn't work. I'll start looking a Windows security features.Thanks! Link to comment Share on other sites More sharing options...
water Posted July 5, 2015 Share Posted July 5, 2015 (edited) Could you please add_AD_ErrorNotify(2)before _AD_Open so we get better error information? Edited July 5, 2015 by water 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...
water Posted July 5, 2015 Share Posted July 5, 2015 -2147023541 (decimal) translates to 0x8007054b (hex) which translates to "The specified domain either does not exist or could not be contacted."Does that sound a bell? 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...
water Posted July 5, 2015 Share Posted July 5, 2015 Are you connected as a domain user when running the script? 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...
gypsy Posted July 5, 2015 Author Share Posted July 5, 2015 Water,Thanks again for the suggestions. Looks like your last comment was the winner. I was running the code as a local users.Really like the AD UDF! Thanks. Link to comment Share on other sites More sharing options...
water Posted July 5, 2015 Share Posted July 5, 2015 Thanks for the feedback. I have added this information to the wiki. 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