water Posted May 26, 2016 Author Posted May 26, 2016 I do not have write access to an AD so the join/unjoin functionality has been tested by other users. Means: I have very limited knowledge about how this all works. The difference between creating a computer and joining a computer is that creating uses LDAP to work with the domain controller. The Join function uses WMi. That's the big difference. 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
AdamUL Posted May 31, 2016 Posted May 31, 2016 @water and @OrangeCoder, I'm having a similar issue. I have had an imaging script that I have have been maintaining for years. I just used the most current version (1.4.4.0 as well as 1.4.3.0) of the AD UDF, and I am getting 1355 errors when adding to AD. I reverted back to using the AD UDF 1.4.2.0, I do not get the error. I believe that I have traced the error down. I also found a reference to it in a previous post. It has to do with lines 3746 and 3747. Here is an example script of that code section that is causing this issue, and what it is doing. Local $sAD_DNSDomain = "DC=ad,DC=something,DC=edu" Local $aDomain = StringSplit($sAD_DNSDomain, ",") ;Line 3746 in 1.4.4.0 UDF. ConsoleWrite(_ArrayToString($aDomain) & @CRLF & @CRLF) Local $sDomainName = StringReplace($aDomain[1], "DC=", "") ;Line 3747 in 1.4.4.0 UDF. ConsoleWrite($sDomainName & @CRLF & @CRLF) It is only setting the domain to "ad", instead of using "ad.something.edu" for the domain for the JoinDomainOrWorkGroup method, and throwing the 1355 error. Here is an example script using the code form version 1.4.2.0. It has the full domain name. Local $sAD_DNSDomain = "DC=ad,DC=something,DC=edu" Local $sDomainName = StringReplace(StringReplace($sAD_DNSDomain, "DC=", ""), ",", ".") ;Line 3729 in 1.4.2.0 UDF. ConsoleWrite($sDomainName & @CRLF & @CRLF) OrangeCoder has the similar multiple "DC=" as well. Adam
water Posted May 31, 2016 Author Posted May 31, 2016 Thanks for the feedback. That's now something I can work with 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
water Posted June 2, 2016 Author Posted June 2, 2016 Version 1.4.5.0 of the UDF has been released. Bugfix in function _AD_JoinDomain. Please test before using in production! 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
OrangeCoder Posted June 2, 2016 Posted June 2, 2016 1 hour ago, water said: Version 1.4.5.0 of the UDF has been released. Bugfix in function _AD_JoinDomain. Please test before using in production! For download please see my signature. Hey water- thank you for the update When I try using the new UDF 1.4.5 I now get @error =5 , @extended - 2224 That's using credentials that don't have a dot in the username either and keeping the script exactly formatted as in post #536 any ideas cheif ?
water Posted June 2, 2016 Author Posted June 2, 2016 Seems the computer already exists - maybe in another OU. https://www.cibengineering.com/blog/active-directory-join-errors/ 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
OrangeCoder Posted June 2, 2016 Posted June 2, 2016 Ah see now that's rediculous! I checked the computers before I ran the script and it wasn't domained Now I went back to check it and it's been joined - it's 7:42 am and I already feel stupid... sorry water Going to try again after renaming it and removing it from the domain
OrangeCoder Posted June 2, 2016 Posted June 2, 2016 Ok this is odd - I refreshed AD and searched for it and I can't find it! Head scratcher
OrangeCoder Posted June 2, 2016 Posted June 2, 2016 Water !!! I could hug you my man - 1.4.5 finally but my issue to rest I can successfully join computers to AD now - I just tried once with renaming the computer and it worked SO beautifully!! You are a good man - anyone says different tell them to come see me
water Posted June 2, 2016 Author Posted June 2, 2016 Glad we could finally solve this problem 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
water Posted June 2, 2016 Author Posted June 2, 2016 44 minutes ago, OrangeCoder said: I could hug you my man Or you could press the "Like this" button until your fingers fall off OrangeCoder 1 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
AdamUL Posted June 2, 2016 Posted June 2, 2016 The new version work fine for me as well. Thank you for the update. Adam
water Posted June 2, 2016 Author Posted June 2, 2016 Great! I just checked version 1.4.2.0 - I have no idea why I changed the code and introduced the bug 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
OrangeCoder Posted June 3, 2016 Posted June 3, 2016 @water or @AdamUL perhaps you guys may know - my join domain and rename script works nicely There is something odd I notice though - when we manually rename and domain a computer - it places the computer in the default container named Computers in AD, not an OU. We then manually move the computer being setup to it's respective OU that has certain group policies applied to it. When we manually rename and domain, it prompts to reboot and we usually let that screen just hang there till we have been moved to their respective OU with group policies applied . We move the computer to the right OU- then reboot them and when it reboots, we can tell right away that the group policies have been applied, cause it forgets the last user who's logged in and has a message prompted on the screen about support etc. Since the UDF can't place the computers in the computers container and it needs to be an OU. I setup an OU called Testing and specified that much in the script. The script works and places the computer in that Testing OU, however when I move the computer to the needed OU with group policies applied and reboot The group policies don't always apply right away - compared to doing it manually. I notice I need to reboot several times and in some cases - unjoin and rejoin the domain to get the group policies to apply. I hope I said all that clear enough to be understood. Any thoughts ?
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