Sign in to follow this  
Followers 0
amfony

_ADGetObjectsInOU (adfunction.au3)

3 posts in this topic

hey guys -- the title says it all really.

using the adfunctions.au3 UDF 3.3 and im using the _ADGetObjectsInOU function to return all users in a OU parent tree and some other attributes like mail, displayName, sAMAccountName. When trying to retrieve description attribute i get nothing. At all. Can anyone confirm that 1 this is possbile and 2 have a quick glance at my code see if its "good"?

windows 2003 domain - AD level native

Thanks and much apprecaited.

#include <adfunctions.au3>
#include <array.au3>

Local $array[1]

_ADGetObjectsInOU($array, "ou=parentOU,dc=domain,dc=local", "(objectCategory=user)", 2, "sAMAccountName,mail,displayName,description", "sAMAccountName")

_ArrayDisplay($array)

ConsoleWrite($array[12][0]&"  "&$array[12][3]&@CRLF)

I used the ConsoleWrite line as a test to catch returned user 12 and spill their details in case arrayDisplay wasnt catching array[0][3] ... its spills everything except description.

Ive testing using ONLY description attribute, putting inbetween mail and samaccountname and still nothing returned.

TIA if anyone can help -- need more info ive forgotten just ask please.

Cheers

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Could you please give the AD UDF a try? It's the successor of the ADFunctions UDF and contains more functions, help files, examples ...

The functions are named similar, the only difference is that you have to use _AD_Open() at the beginning and _AD_Close() at the end of your script.

For download please see my signature.

If I remember correctly description is a multivalue attribute. Such attributes are not returned by _ADGetObjectsInOU (adfunctions.au3). _AD_GetObjectsInOU (AD.au3) returns such values as a string separateted by a concatenator character.

If you have any problems, please ask the question in the "help and support thread" (see signature)

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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 -- thank you for your help the new AD_* function fixed my issue immediatley.

Also thank you for adding so many more functions and updates (especially the help files) to the adfunctions.AU3 predecessor.

I look forward to re-writing all my AD related scripts with the new AD.au3

Regards,

Jesus

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
Sign in to follow this  
Followers 0