water Posted November 20, 2012 Author Share Posted November 20, 2012 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 More sharing options...
amichae1 Posted November 27, 2012 Share Posted November 27, 2012 Hi ya, I am very new to this site and have very basic skills at scripting. I am simply trying to use the lastest Active Directory UDF but do not know how to implement it into AutoIt. There is a downloadable Zip file, AD1.3.0.0 and I simply don't know what to do with it. Any help will be greatly apprecated. With Warm Regards, Andreas Link to comment Share on other sites More sharing options...
water Posted November 27, 2012 Author Share Posted November 27, 2012 The ZIP file contains the following files:Ad.au3 - the UDF itself. This needs to be included by your script_AD_*.au3 - Example scripts for every function. Ready to run_AD_*.htm - Help files for every function. Ready to rundefault.css - Cascading Style Sheet used by the htm filesau3.userudfs.properties - List of functions to be used by the SciTE editorau3.user.calltips.api - Calltips used by the SciTE EditorReadMe.txt - Contains the description how to "install" the UDFHistory.txt - As the name saysDownload the ZIP file, unpack it to a temporary directory and read the ReadMe.txt.If you still have questions I will be happy to help. 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 More sharing options...
bartekd Posted December 6, 2012 Share Posted December 6, 2012 (edited) Great excuses. Function _AD_DisablePasswordExpire works perfectly. But Func _AD_DisablePasswordChange doesnt work at all After $Result = _AD_DisablePasswordChange("username") ConsoleWrite("Result: " & $Result & ", error: " & @error & ", extended: " & @extended) i have Result: 0, error: -2147352567, extended: 0 Thank you for support. I am having this issue (Error -2147352567) when I set _AD_SetPassword to something. Do you know what permissions need to be delegated in Active directory in order to _AD_SetPassword? Also, just to add that this user is able to reset the password using Active Directory Users and Computers, but I am unable to use the _AD_SetPassword script. Please help. Edited December 6, 2012 by bartekd Link to comment Share on other sites More sharing options...
water Posted December 7, 2012 Author Share Posted December 7, 2012 Which version of the UDF do you use? Which AutoIt version do you run? 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 More sharing options...
bartekd Posted December 7, 2012 Share Posted December 7, 2012 Autoit version 3.3.8.1 UDF Version ...: 0.41 Link to comment Share on other sites More sharing options...
water Posted December 7, 2012 Author Share Posted December 7, 2012 Version 0.41 of the UDF is very, very old. Please download the current version 1.3.0.0. For download please see my signature. 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 More sharing options...
bartekd Posted December 7, 2012 Share Posted December 7, 2012 I tried updating it, but the syntax has changed for allot of the functions that I use. Link to comment Share on other sites More sharing options...
water Posted December 7, 2012 Author Share Posted December 7, 2012 Which functions do you have in mind? The history shows a few script breaking changes - but for some "exotic" functions. Version 0.41 has a serious connection bug so I strongly recommend to upgrade to the latest version. 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 More sharing options...
bartekd Posted December 7, 2012 Share Posted December 7, 2012 (edited) First one that I notice when I replaced my versionWhen I try to find a user, I use this. It comes back with no users could be found$aList = _AD_GetObjectsInOU("", "(&(objectCategory=person)(objectClass=user)(|((displayName=*" & $SearchUser & "*)(name=*" & $SearchUser & "*)(cn=*" & $SearchUser & "*)(anr=" & $SearchUser & "))))", 2, "displayname,sAMAccountName");Part of nameWhen I reset or unlock a user, it can't find the user. I do everything based on the username of the person Edited December 7, 2012 by bartekd Link to comment Share on other sites More sharing options...
water Posted December 7, 2012 Author Share Posted December 7, 2012 No changes have been made to _AD_GetObjectsInOU that would affect the way you use the function. What's the value of @error after you have called the function? 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 More sharing options...
bartekd Posted December 7, 2012 Share Posted December 7, 2012 When I run it, it gives error = 2. Link to comment Share on other sites More sharing options...
water Posted December 7, 2012 Author Share Posted December 7, 2012 This runs fine here. Could you try and post the result you get on the SciTE console? #include <ad.au3> _AD_Open() ConsoleWrite(@error & "-" & @extended & @LF) Global $SearchUser = "Thomas" Global $aList = _AD_GetObjectsInOU("", "(&(objectCategory=person)(objectClass=user)(|((displayName=*" & $SearchUser & "*)(name=*" & $SearchUser & "*)(cn=*" & $SearchUser & "*)(anr=" & $SearchUser & "))))", 2, "displayname,sAMAccountName") ConsoleWrite(@error & "-" & @extended & @LF) _ArrayDisplay($aList) _AD_Close() 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 More sharing options...
bartekd Posted December 7, 2012 Share Posted December 7, 2012 (edited) Strange, when I run your script alone, it runs fine, but when I put your exact lines in my script, I get this 2-169 Could it be conflicting with any of the same variable names? Edited December 7, 2012 by bartekd Link to comment Share on other sites More sharing options...
water Posted December 7, 2012 Author Share Posted December 7, 2012 Very strange. Can you post your script? 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 More sharing options...
bartekd Posted December 7, 2012 Share Posted December 7, 2012 I think I figured it out. If I have any other errorhandler, it will give this issue, If I disable the error handlers that I have, it works fine. Do you know if there was any changes to the error handler in your UDF? If so, how do I either disable it, or have it work in addition to my current 2 error handlers? Link to comment Share on other sites More sharing options...
water Posted December 7, 2012 Author Share Posted December 7, 2012 When you call _AD_Open and run AutoIt version < 3.3.9.2 then the COM error handler of the UDF is enabled - if you haven't already defined a COM error handler. Define your COM error handler before calling _AD_Open and the AD COM Error handler will not be activated. 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 More sharing options...
bartekd Posted December 7, 2012 Share Posted December 7, 2012 (edited) Still doesn't seem to work. Here is an example. I know I don't need the IE error handler in this example, but I am registering it to see if it causes issues. #include <IE.au3> _IEErrorHandlerRegister() #include <ad.au3> _AD_Open() ConsoleWrite(@error & "-" & @extended & @LF) Global $SearchUser = "thomas" Global $aList = _AD_GetObjectsInOU("", "(&(objectCategory=person)(objectClass=user)(|((displayName=*" & $SearchUser & "*)(name=*" & $SearchUser & "*)(cn=*" & $SearchUser & "*)(anr=" & $SearchUser & "))))", 2, "displayname,sAMAccountName") ConsoleWrite(@error & "-" & @extended & @LF) _ArrayDisplay($aList) _AD_Close() Edited December 7, 2012 by bartekd Link to comment Share on other sites More sharing options...
water Posted December 7, 2012 Author Share Posted December 7, 2012 Found the problem. Please replace line If $__iAD_Debug = 0 And Number(StringReplace(@AutoItVersion, ".", "")) < 3392 Then _AD_ErrorNotify(1)in function _AD_Open withIf $__iAD_Debug = 0 And Number(StringReplace(@AutoItVersion, ".", "")) < 3392 Then _AD_ErrorNotify(1) SetError(0) EndIf 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 More sharing options...
bartekd Posted December 7, 2012 Share Posted December 7, 2012 Nice, Thanks. That seems to have done the trick, I am able to use the new version now. But going back to the original problem, it is still there. Do you know what rights need to be delegated to the user in order to setpassword? Link to comment Share on other sites More sharing options...
Recommended Posts