D
DMc2007
Hi
Does the Win32_ComputerSystem method UnjoinDomainOrWorkgroup support Windows
2000 Clients, as I am getting am error on the following:
Const NETSETUP_ACCT_DELETE = 2 'Disables computer account in domain.
strPassword = "SW2009Feb10792-d"
strUser = "SWCAMW"
Dim intreturn
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)
Basically i am trying to remove a Windows 2000 Workstation from a Domain.
Regards
D
Does the Win32_ComputerSystem method UnjoinDomainOrWorkgroup support Windows
2000 Clients, as I am getting am error on the following:
Const NETSETUP_ACCT_DELETE = 2 'Disables computer account in domain.
strPassword = "SW2009Feb10792-d"
strUser = "SWCAMW"
Dim intreturn
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)
Basically i am trying to remove a Windows 2000 Workstation from a Domain.
Regards
D