Jump to content

_AD_GetObjectAttribute gives unexpected result


Nogo
 Share

Recommended Posts

Hello

I'm trying to get email from AD with _AD_GetObjectAttribute.

the following script gives back email adress for given sAMAccountName:

#include <AD.au3>
Global $aProperties
_AD_Open()
If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended)
$aProperties = _AD_GetObjectAttribute("anysAMAccountName", "mail")
ClipPut($aProperties)
MsgBox(0,"",$aProperties)
_AD_Close()

Tried many sAMAccountName's it works good, but on one Name 'XiaopenL' result is:

'$FUNCTION.CONET_JS_toLowerCase($FUNCTION.CONET_JS_CheckEMail($FUNCTION.CONET_JS_changeUmlaut($FUNCTION.CONET_JS_getFirstPart(Lu)$$)$$.$FUNCTION.CONET_JS_changeUmlaut($FUNCTION.CONET_JS_getFirstPart(Xiaopeng)$$)$$@xxx.xx!!99999999)$$)$$'

This is not the mail adress. Is it a failure of the AD-server?

Edited by Nogo
Link to comment
Share on other sites

Please a look at this site. It describes attributee mail and proxyAddresses.

Could you get the values of attribute "proxyAddresses"? Be aware that it is a multivalue attribute and hence _AD_GetObjectAttribute returns an array.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Could you get the values of attribute "proxyAddresses"?

No it is not set.

But I've downloaded 'Active Directory Explorer'. -> The mail adress of sAMAccountName "XiaopenL" is set to

$FUNCTION.CONET_JS_toLowerCase($FUNCTION.CONET_JS_CheckEMail($FUNCTION.CONET_JS_changeUmlaut($FUNCTION.CONET_JS_getFirstPart(Lu)$$)$$.$FUNCTION.CONET_JS_changeUmlaut($FUNCTION.CONET_JS_getFirstPart(Xiaopeng)$$)$$@xxx.xx!!99999999)$$)$$

So everything is working ok. The Database is not tended right.

I didn't expected that this is the failure.

Many thanks for your help and for the link.

Edited by Nogo
Link to comment
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
 Share

×
×
  • Create New...