The join domain task that has worked with all my Windows 8 deployments does not seem to work with Windows 10 x64 1607.  Has anyone else had issues with that.  It just fails and says unknown error.
1 Comment   [ + ] Show Comment

Comments

  • Here's what I use to both join domain and drop into a specific OU on both Win7 and Win10 deployments.

    Post-install task parameter (credentials must have domain joining permissions):

    cscript join_domain_and_OU.vbs my.domain.com domainacct password OU=x,DC=x,DC=x,DC=x

    "Join_Domain_and_ou" VBS Script:

    Const JOIN_DOMAIN = 1
    Const ACCT_CREATE = 2
    Const ACCT_DELETE = 4
    Const WIN9X_UPGRADE = 16
    Const DOMAIN_JOIN_IF_JOINED = 32
    Const JOIN_UNSECURE = 64
    Const MACHINE_PASSWORD_PASSED = 128
    Const DEFERRED_SPN_SET = 256
    Const INSTALL_INVOCATION = 262144

    If WScript.Arguments.Count < 4 or WScript.Arguments.Count > 5 Then
    WScript.Quit
    Else
    strDomain = WScript.Arguments.Item(0)
    strUser = WScript.Arguments.Item(1)
    strPassword = WScript.Arguments.Item(2)
    strOU = WScript.Arguments.Item(3)

    'set DNS IP address
    If WScript.Arguments.Count = 5 Then
    strDNSIP = WScript.Arguments.Item(4)
    Set objShell = CreateObject("WScript.shell")
    objShell.Run "netsh int ip set dns ""local area connection"" static "& _
    strDNSIP &" primary",0,0
    End If

    End If


    Set objNetwork = CreateObject("WScript.Network")
    strComputer = objNetwork.ComputerName

    Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _
    strComputer & _
    "\root\cimv2:Win32_ComputerSystem.Name='" _
    & strComputer & "'")
    ReturnValue = objComputer.JoinDomainOrWorkGroup(strDomain, _
    strPassword, strDomain & "\" & strUser, strOU, _
    JOIN_DOMAIN + ACCT_CREATE + DOMAIN_JOIN_IF_JOINED)
Please log in to comment

Answers

0
I would go to the log at \windows\debug\netsetup.log and see what it shows as this should be where it logs the join domain actions. 

If the machine is part of a domain already you might want to use the power-shell script that it would be ok with the name being there and just add it to the machine.
https://support.quest.com/kace-systems-deployment-appliance/kb/155655
Answered 02/10/2017 by: TheAustinDave
Green Belt

Please log in to comment
Answer this question or Comment on this question for clarity