davzell13 Posted August 2, 2017 Share Posted August 2, 2017 2 and 0 Link to comment Share on other sites More sharing options...
water Posted August 2, 2017 Author Share Posted August 2, 2017 @error = 2 stands for: $sOU does not exist 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...
davzell13 Posted August 2, 2017 Share Posted August 2, 2017 yes i have see that on the udf but i don't understand why. if you look the attached screen i have the Users OU no ? Link to comment Share on other sites More sharing options...
water Posted August 2, 2017 Author Share Posted August 2, 2017 You need to specify $sOU as FQDN. Example (taken from the UDF Header documentation): OU=sampleou,OU=sampleparent,DC=sampledomain1,DC=sampledomain2 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...
davzell13 Posted August 2, 2017 Share Posted August 2, 2017 (edited) like this ? $sOU = '"OU=Users,DC=test,DC=local"' $sUser = "Test" $sCN = "Server-Name" $iResult = _AD_Open("Administrateur", "Adm-Password", "DC=test,DC=local", "Server-Name.test.local", "CN=Server-Name,DC=test,DC=local") MsgBox(48, "resultat", $iResult ) _AD_CreateUser($sOU, $sUser, $sCN)  Edit, it's works, but only on a computer on the domain. Not on workgroup computer   Edited August 2, 2017 by davzell13 Link to comment Share on other sites More sharing options...
water Posted August 2, 2017 Author Share Posted August 2, 2017 Define "does not work". As mentioned above, please provide some information about the error. 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...
davzell13 Posted August 2, 2017 Share Posted August 2, 2017 (edited) _AD_Open  dosn't works. $iResults return 0. If it works the variable return1.  EDIT: in  CN= i have write the name of my domain controller. Is it true ? $iResult = _AD_Open("Administrateur", "Adm-Password", "DC=test,DC=local", "Server-Name.test.local", "CN=Server-Name,DC=test,DC=local") Edited August 2, 2017 by davzell13 Link to comment Share on other sites More sharing options...
water Posted August 2, 2017 Author Share Posted August 2, 2017 How to connect to a domain is described in the wiki. 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...
davzell13 Posted August 2, 2017 Share Posted August 2, 2017 (edited) i have read the wiki and use this script on my domain controler to have good information to add in my _AD_Open #include <AD.au3> _AD_Open() ConsoleWrite($sAD_DNSDomain & @CRLF) ConsoleWrite($sAD_HostServer & @CRLF) ConsoleWrite($sAD_Configuration & @CRLF) _AD_Close()  but same error with the good information $iResult = _AD_Open("Administrateur", "Adm-Password", "DC=test,DC=local", "Server-Name.test.local", "CN=Configuration,DC=test,DC=local")  edit: if i add @error i have error 4  and @extended 2147016646 Edited August 2, 2017 by davzell13 Link to comment Share on other sites More sharing options...
water Posted August 2, 2017 Author Share Posted August 2, 2017 Please insert _AD_ErrorNotify(2) before _AD_Open to get more detailed error information. 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...
davzell13 Posted August 2, 2017 Share Posted August 2, 2017 Link to comment Share on other sites More sharing options...
water Posted August 2, 2017 Author Share Posted August 2, 2017 Could you please try one of the other two possible ways to provide the UserId as described here? Quote NetBIOS Login Name e.g. "microsoft\DJ" User Principal Name e.g. "DJ@microsoft.com" So LDAP knows that it shouldn't use the local Administrator. 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...
davzell13 Posted August 3, 2017 Share Posted August 3, 2017 same error, but i have tested on two different server and the code works. I think I know where the problem may come from. the domain is: test.local and the computer out of domain is in workgroup named: test  Can not it be a problem? Link to comment Share on other sites More sharing options...
water Posted August 3, 2017 Author Share Posted August 3, 2017 Could be, yes. But I'm not sure. 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...
davzell13 Posted August 3, 2017 Share Posted August 3, 2017 hello Water, i have a new error. My script works well now on computer out of domain.  Now i try to use my script since a WinPE (from Windows 10 64bits source). I have a COM error (800401F3) . i think it's because is it a limited Windows with not all the Dll of Windows or something like this.  do you have an idea ?  Dll to integrate in my WinPE ?  thanks  Link to comment Share on other sites More sharing options...
water Posted August 3, 2017 Author Share Posted August 3, 2017 For Windows PE you need what is described 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...
davzell13 Posted August 4, 2017 Share Posted August 4, 2017 it works, thanks Water. Link to comment Share on other sites More sharing options...
water Posted August 4, 2017 Author Share Posted August 4, 2017 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...
JonF Posted August 28, 2017 Share Posted August 28, 2017 (edited) I'm trying to set up a remote LDAP query.  I want to use SSL, of course.  My code is: _AD_Open("<redacted>\<redacted>", "<redacted>", "", "mail.<redacted>.com", "", 3) If the last parameter is 1, it works.  If the last parameter is 3 it doesn't, see the image. It does the same thing if I am really remote or in the office.  The server has a valid GoDaddy certificate.  Do I need a client certificate? I can't figure out the extended code, it looks like a hex value interpreted as a signed integer but I don't know how to convert it. Edited August 28, 2017 by JonF Link to comment Share on other sites More sharing options...
water Posted August 28, 2017 Author Share Posted August 28, 2017 Correct. In hex it is 0x80020009. This simply means: An error has occurred (and hence doesn't help much). Can you please add _AD_ErrorNotify(2) at the top of your script so we get meaningful COM error Information? 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...
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