Hello all, I have this script below that worked under Windows XP Pro, but on a Windows 7 x64 it will ONLY join the workgroup and not the domain. If anyone has an idea what is happening I would really appreciate it. Thank you.
;**************************************************************************************************************
;**************************************** Join Domain ****************************************
;**************************************************************************************************************
SplashTextOn("", "Attempting to Join ABC.LOCAL Domain... Please wait one moment...", 600, 44,-1,160, 1, "Arial", 14)
Sleep(5000)
Global Const $JOIN_DOMAIN = 1
Global Const $ACCT_CREATE = 1
$strAdminAccount = "adminaccount"
$strAdminPass = "adminpass"
$strComputer = "."
$strDomainName = "abc.local"
$objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
$colCompSystems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
For $objCompSystem In $colCompSystems
$intJOIN_DOMAIN = $objCompSystem.JoinDomainOrWorkgroup($strDomainName, $strAdminPass, $strDomainName & '\' & $strAdminAccount, '', $JOIN_DOMAIN + $ACCT_CREATE)
If $intJOIN_DOMAIN = 0 Then
SplashTextOn("", "Joined computer to " & $strDomainName & " domain... - " & $intJOIN_DOMAIN, 600, 44,-1,160, 1, "Arial", 14)
Sleep(5000)
Else
MsgBox(0, @ScriptName, "Unable to join computer to " & $strDomainName & " domain. - " & $intJOIN_DOMAIN)
Sleep(5000)
EndIf
Next