Hi U all..
Is there a way to do as follow by script.
I'm about to change domain on our network (1000 clients) The former admin dident set things upp right and it's time for a littel cleaning. The old domain is location.mydomain.com and the new domain is mydomain.com, bacause the two domains overlap i cant have them on the same network. So i have to change to the new domain without having the old domain present. And as i have tested i have discovered that i cant use netdom without having both domains present. My task is to move the computers to a workgroup then change computername and finaly add it to the new domain. I'm not going to do this by logonscript, i am going to go to every computer and make the proper changes (me and 5 other people that dont have computer experiens, so i have to have it flawless). I have looked a littel on the microsoft example and i cant get the hang of it. The microsoft example is this. All the computers in the network is Windows XP.
Can someone explain the script for me and try to explain how i should crack this beast...
Thanks for all help i could get..
UnJoin script..
Join script
Is there a way to do as follow by script.
I'm about to change domain on our network (1000 clients) The former admin dident set things upp right and it's time for a littel cleaning. The old domain is location.mydomain.com and the new domain is mydomain.com, bacause the two domains overlap i cant have them on the same network. So i have to change to the new domain without having the old domain present. And as i have tested i have discovered that i cant use netdom without having both domains present. My task is to move the computers to a workgroup then change computername and finaly add it to the new domain. I'm not going to do this by logonscript, i am going to go to every computer and make the proper changes (me and 5 other people that dont have computer experiens, so i have to have it flawless). I have looked a littel on the microsoft example and i cant get the hang of it. The microsoft example is this. All the computers in the network is Windows XP.
Can someone explain the script for me and try to explain how i should crack this beast...
Thanks for all help i could get..
UnJoin script..
Code:
Const NETSETUP_ACCT_DELETE = 2 'Disables computer account in domain.
strPassword = "password"
strUser = "kenmyer"
Set objNetwork = CreateObject("WScript.Network")
strComputer = objNetwork.ComputerName
Set objComputer = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" & _
strComputer & "\root\cimv2:Win32_ComputerSystem.Name='" & strComputer & "'")
strDomain = objComputer.Domain
intReturn = objComputer.UnjoinDomainOrWorkgroup _
(strPassword, strDomain & "\" & strUser, NETSETUP_ACCT_DELETE)
Join script
Code:
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
strDomain = "FABRIKAM"
strPassword = "ls4k5ywA"
strUser = "shenalan"
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, NULL, _
JOIN_DOMAIN + ACCT_CREATE)