water Posted May 19, 2016 Author Share Posted May 19, 2016 So the line I told you to comment/remove in post #511 is still active. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
OrangeCoder Posted May 19, 2016 Share Posted May 19, 2016 hey water - good morning - I just checked and the line is commented out just to confirm: it was only one line I was commenting out in AD.au3 like 3757 that reads If $oComputer.Domain - $sDomainName Then Return SetError(4,0,0) correct ? Link to comment Share on other sites More sharing options...
water Posted May 19, 2016 Author Share Posted May 19, 2016 Correct. This line should now read ; If $oComputer.Domain = $sDomainName Then Return SetError(4,0,0) You get @error = 4 but this is the only place in function _AD_JoinDomain where @error = 4 is being set My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted May 19, 2016 Author Share Posted May 19, 2016 Something else: It seems the script needs to be run with elevated Admin permissions. Could you please insert #RequireAdmin at the top of your script? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
OrangeCoder Posted May 19, 2016 Share Posted May 19, 2016 CHECK- I do have #RequireAdmin in the script Thank you for confirming the comment on the AD.au3 cause it was indeed commented out However when I run it - I still get @error=5 @extended = 1355 Link to comment Share on other sites More sharing options...
water Posted May 19, 2016 Author Share Posted May 19, 2016 We need to check that we pass valid data to JoinDomainorWorkgroup. Could you please insert this line ConsoleWrite($sDomainName & "||" & $sJoinPassword & "||" & $sJoinUser & "||" & $sOU & "||" & $iFlag & @CRLF) before ; Join the computer to the domain $iResult = $oComputer.JoinDomainOrWorkGroup($sDomainName, $sJoinPassword, $sJoinUser, $sOU, $iFlag) in function _AD_JoinDomain. Replace any sensitive information with xxx before posting here My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
OrangeCoder Posted May 19, 2016 Share Posted May 19, 2016 I think I follow - you want me to add this line of code in which file ? The AD.au3 or the _AD_JoinDomain.au3 file ? I think it's the first - but just wanted to confirm Link to comment Share on other sites More sharing options...
water Posted May 19, 2016 Author Share Posted May 19, 2016 Confirmed! It's AD.au3 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
OrangeCoder Posted May 19, 2016 Share Posted May 19, 2016 XXXX||xxxxxxxxx||xxxx\xxxxxxx||OU=xxxxx,DC=xxxx,DC=xxxxxxx,DC=xxx,DC=xx,DC=xx||35 Link to comment Share on other sites More sharing options...
NDTerri Posted May 20, 2016 Share Posted May 20, 2016 I apologize if this question has already been addressed, but I haven't found any references to it.... I just downloaded and included AD.au3, and I'm getting an error from the UDF that $KEYWORD_NULL and $STR_NO_COUNT are not declared. It occurs in the _AD_GetObjectsInOU (KEYWORD_NULL) and _AD_GetObjectProperties (STR_NO_COUNT) functions. I've attached a screenshot of the errors. Am I missing something? Link to comment Share on other sites More sharing options...
water Posted May 21, 2016 Author Share Posted May 21, 2016 (edited) Seems you run AutoIt 3.3.10.2. Those variables are part of later versions (at least 3.3.12.0 I think). Edited May 23, 2016 by water NDTerri 1 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
OrangeCoder Posted May 21, 2016 Share Posted May 21, 2016 8 hours ago, water said: Hey water - where you talking to NDTerri or talking to me ? Link to comment Share on other sites More sharing options...
water Posted May 21, 2016 Author Share Posted May 21, 2016 NDTerri. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
NDTerri Posted May 23, 2016 Share Posted May 23, 2016 Thank you, water. I upgraded to v 3.3.14.2 and it fixed the problem. Since I had been running v 3.3.10.2, I had assumed AD 1.4.4.0 would run based on a previous post: Thanks for the clarification and for your QUICK reply. I really appreciate it. Link to comment Share on other sites More sharing options...
water Posted May 23, 2016 Author Share Posted May 23, 2016 Thanks for the heads up. Fixed! My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
OrangeCoder Posted May 24, 2016 Share Posted May 24, 2016 Hey Water - when I tried credentials that didn't have the dot in the username I still got a @error=5, @extended = 1355 #RequireAdmin #include <AD.au3> _AD_Open("XXXX\xxxxxxx", "xxxxxx", "DC=xxxx,DC=xxxxxx,DC=xxx,DC=xx,DC=xx","xx-xx-x.xxxx.xxxxxxx.xxx.xx.xx","CN=Configuration,DC=xxxx,xx=xxxxxxx,DC=xxx,DC=xx,DC=xx") If @error Then Exit MsgBox(0, "Error", "_AD_Open: @error = " & @error & ", @extended = " & @extended) _AD_JoinDomain(@ComputerName,"","","OU=xxxxxxxx,DC=xxxx,DC=xxxxxxx,DC=xxx,DC=xx,DC=xx",35) If @error Then Exit MsgBox(0, "Error", "_AD_JoinDomain: @error = " & @error & ", @extended = " & @extended) Else MsgBox(0, "Success", "_AD_JoinDomain: @error = " & @error & ", @extended = " & @extended) EndIf _AD_Close() Exit Link to comment Share on other sites More sharing options...
Kaimberex Posted May 24, 2016 Share Posted May 24, 2016 (edited) EDIT: I Have Played with the code a little and got it to do what I want. I am attemping to use the function _AD_GetGroupMembers () In the AD.au3 it says _AD_GetGroupMembers () returns a one-based one dimensional array of names (FQDN) that are members of the specified group. Is there a way to have this function return the array of names as Display names? I have tried to use _AD_FQDNToDisplayname but it just returns a "-1" I am still learning Autoit and am not very good with Arrays just yet. Any help would be appreciated! Thanks. Edited May 24, 2016 by Kaimberex Figured out what I was doing wrong. Link to comment Share on other sites More sharing options...
water Posted May 24, 2016 Author Share Posted May 24, 2016 OrangeCoder, maybe this site helps you to diagnose the problem: https://technet.microsoft.com/en-us/library/cc961817.aspx My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted May 24, 2016 Author Share Posted May 24, 2016 2 hours ago, Kaimberex said: EDIT: I Have Played with the code a little and got it to do what I want. Glad you could solve your problem My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
OrangeCoder Posted May 26, 2016 Share Posted May 26, 2016 hey water- I am going to look into that - thank you however I am not understanding - something hopefully you can clear up for me If I call AD Create Computer - it works without issue So that would mean that AD Open - works My credentials are also accepted if I could successfully call AD_CreateComputer and the computer actually shows up in AD So would I have a problem authenticating ? Link to comment Share on other sites More sharing options...
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