Jump to content
gypsy

Help with AD.au3

Recommended Posts

gypsy

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: -2147023541

In 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.0

Any 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

 

 

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
gypsy

Water,

Thanks for the suggestion.  I tried it and it still doesn't work.  I'll start looking a Windows security features.

Thanks!

Share this post


Link to post
Share on other sites
water

Could you please add

_AD_ErrorNotify(2)

before _AD_Open so we get better error information?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

-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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Are you connected as a domain user when running the script?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
gypsy

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.

 

Share this post


Link to post
Share on other sites
water

Thanks for the feedback. I have added this information to the wiki.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×