amfony Posted May 27, 2010 Posted May 27, 2010 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
water Posted May 27, 2010 Posted May 27, 2010 (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 May 28, 2010 by water 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
amfony Posted May 30, 2010 Author Posted May 30, 2010 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
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