deeptrancer Posted March 15, 2010 Share Posted March 15, 2010 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. Link to comment Share on other sites More sharing options...
99ojo Posted March 26, 2010 Share Posted March 26, 2010 Hi water, Problems with _AD_GetObjectsInOU. Searchscope param base and onelevel doesn't work. I got always subtree results. Client: XP SP3, Autoit 3.3.4.0, AD.au3 0.37 AD Win2003 SP2. Regards Stefan Link to comment Share on other sites More sharing options...
water Posted March 28, 2010 Author Share Posted March 28, 2010 (edited) @deeptrancer Error: -2147352567 (hex: 80020009: DISP_E_EXCEPTION - Unanticipated error occurred) usually means you have no write access to the AD. This is not very specific because AD doesn't return any further information (or this information is not accessible by AutoIt). Could you please check that you have full access to the AD by using the Microsoft MMC to set the option in AD? Edited March 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 Link to comment Share on other sites More sharing options...
water Posted March 28, 2010 Author Share Posted March 28, 2010 (edited) @ 99ojo I see. Could you please change line 1098 from$oAD_Command.CommandText = ";" & $sAD_Filter & ";" & $sAD_DataToRetrieve & ";subtree"to$oAD_Command.CommandText = ";" & $sAD_Filter & ";" & $sAD_DataToRetrieveand then post the test results? Edited March 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 Link to comment Share on other sites More sharing options...
99ojo Posted March 29, 2010 Share Posted March 29, 2010 Hi water, that's it. Works like expected. Thanks a lot. ;-)) Stefan Link to comment Share on other sites More sharing options...
water Posted March 31, 2010 Author Share Posted March 31, 2010 Hello, is it possible to specify a username and password when connecting to AD?can AdOpen be used with, $sAD_UserIdParam and $sAD_PasswordParam?but what is the correct way to use them?Thanks for any help Yes you can. Please have a look at _AD_Open.htm. It describes the parameters you can use and the format of the parameters. 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...
Erlend Posted March 31, 2010 Share Posted March 31, 2010 Can it be used like this? do i have to specify $SDNSDomain, $SHostServer, $SConfiguration? $SUserid =("user1") $SPassword=("password1") _AD_Open($SUserId, $SPassword,) ;rest of application under: Thanks Link to comment Share on other sites More sharing options...
Joe2010 Posted March 31, 2010 Share Posted March 31, 2010 @Erlend #include <AD.au3> #include <Array.au3> ;Full Name: John Doe ;UserAccount: JD ;Password: 1234 ; Open Connection to the Active Directory _AD_Open("JD", "1234") If @error = 0 Then MsgBox(64, "Active Directory Functions", "We didn't receive a COM error - the logon was succcessful!") ;This comes everytime because @error is always 0. A COM error comes below in example 1. Else MsgBox(16, "Active Directory Functions", "The logon was not succcessful!" & @CRLF & @CRLF & "@error: " & @error & ", @extended: " & @extended) EndIf ; ***************************************************************************** ; Example 1 ; Get a list of all Domain Controllers in the Active Directory ; ***************************************************************************** Global $aDC $aDC = _AD_ListDomainControllers() _ArrayDisplay($aDC, "Active Directory Functions - Example 1 - All Domain Controllers, distinguished name, DNS host name, and the site name") ; ***************************************************************************** ; Example 2 ; Get a list of all Sites Names ; ***************************************************************************** Global $aSite _ArraySort($aDC, 0, 1, 0, 3) $aSite = _ArrayUnique($aDC, 4, 1) _ArrayDisplay($aSite, "Active Directory Functions - Example 2 - All Site Names") ; Close Connection to the Active Directory _AD_Close() Link to comment Share on other sites More sharing options...
supersonic Posted April 1, 2010 Share Posted April 1, 2010 (edited) Hi Water! There seems to be a (little, I hope) problem with _AD_GetObjectsInOU() in the current version 0.37 - querying for groups returns an empty array... In the older version 0.33 _AD_GetObjectsInOU() it works normal. Here's my test code: #include <Array.au3> #include ".\..\AUTOIT\Include\Water\AD\AD.au3" #include ".\_AD_GetObjectsInOU_OLD.au3" ; AD.au3 V0.33 _AD_Open() Global $test1 Global $test2 Global $test3[1] $test1 = _AD_GetObjectsInOU("DC=de01,DC=itvollmann,DC=com", "(&(objectCategory=group))", 2) _ArrayDisplay($test1, "1") $test2 = _AD_GetObjectsInOU("DC=de01,DC=itvollmann,DC=com", "(&(objectCategory=group))", 2, "samAccountName,samAccountName") _ArrayDisplay($test2, "2") _AD_GetObjectsInOU_OLD($test3, "DC=de01,DC=itvollmann,DC=com", "(&(objectCategory=group))", 2) _ArrayDisplay($test3, "3") _AD_Close() The result of the second test is a bit strange. Even when specified "samAccountName," (mind the comma!) it works, but this will result in a 2D array... This problem occurs no matter which filter (name=*, objectCategory=group, objectCategory=user, etc.) I use. This could be a problem with the array handling in this function...??? May be you can help me fixing this flaw. Greets, Happy Eastern!, -supersonic. Edited April 1, 2010 by supersonic Link to comment Share on other sites More sharing options...
99ojo Posted April 1, 2010 Share Posted April 1, 2010 Hi,have you changed:Known bugs: (last updated: 2010-03-28)•_AD_GetObjectsInOU: Returns an empty array when the parameter $sAD_DataToRetrieve consists of a single value.As a workaround please replace $aAD_DataToRetrieve with $sAD_DataToRetrieve in line 1129, 1130 and 1133See:http://www.autoitscript.com/forum/index.php?showtopic=106163;-))Stefan Link to comment Share on other sites More sharing options...
supersonic Posted April 1, 2010 Share Posted April 1, 2010 Thank you! :-) Link to comment Share on other sites More sharing options...
water Posted April 5, 2010 Author Share Posted April 5, 2010 Version 0.38 has been released. For download please see 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...
ICANSEEYOU7687 Posted April 12, 2010 Share Posted April 12, 2010 Version 0.38 has been released. For download please see signature.just tried _AD_CreateMailbox.au3and I get an error when opening it.But I love these scripts has made my life a bit easier. Link to comment Share on other sites More sharing options...
water Posted April 12, 2010 Author Share Posted April 12, 2010 (edited) What error do you get? COM error?Or return value <> 1? If yes, what is @error and @extended set to?How do you call the funcion? Which parameters do you provide? Edited April 12, 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 Link to comment Share on other sites More sharing options...
ICANSEEYOU7687 Posted April 12, 2010 Share Posted April 12, 2010 oh sorry, lol I was at work and a customer came in so I didnt have a chance to look at it thoroughly. but it was in the _AD_CreateMailbox.au3 example script. Just yelling at my for some local variables not being declared. Link to comment Share on other sites More sharing options...
water Posted April 13, 2010 Author Share Posted April 13, 2010 The example script runs fine here. Can you please post a copy of the error messages? 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...
ICANSEEYOU7687 Posted April 15, 2010 Share Posted April 15, 2010 it gives me an error that says Line 37 (File "C:\path\autoit\_AD_CreateMailbox.au3"); $IMailbox = GUICtrlCreatInput($SMailbox,241,40,259,21) $Mailbox = GUICtrlCreareInput(^ERROR Error: Variable used without being declared I tried declaring the variable same error. I think im doing something stupid. Maybe it cant find the exchange server or something Link to comment Share on other sites More sharing options...
water Posted April 17, 2010 Author Share Posted April 17, 2010 I will have a look at it as soon as I return from vacation. Due to the volcano in Island this could take some time - at least 1 week. 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...
MattZ Posted April 17, 2010 Share Posted April 17, 2010 I rewrote my script so it uses AD.au3 instead of ADFunctions.au3. Everything is working as expected except for _AD_MoveObject. I added the error logging from the example script and get a -2147352567 from Active Directory. I can manually move the object without any problems. I am also removing all the groups from the user, disabling the account and changing the password without issues. Any Ideas? Link to comment Share on other sites More sharing options...
water Posted April 23, 2010 Author Share Posted April 23, 2010 (edited) I rewrote my script so it uses AD.au3 instead of ADFunctions.au3. Everything is working as expected except for _AD_MoveObject. I added the error logging from the example script and get a -2147352567 from Active Directory. I can manually move the object without any problems. I am also removing all the groups from the user, disabling the account and changing the password without issues.Any Ideas?Can you please post the code you use? You can strip it down to the _AD_Open and _AD_MoveObject calls.What do you move? A User or a Computer? If it's a computer you have to append a "$" to the computers name. Edited April 24, 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 Link to comment Share on other sites More sharing options...
Recommended Posts