![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | UnjoinDomainOrWorkgroup Windows 2000 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 |
My System Specs![]() |
| | #2 (permalink) |
| | Re: UnjoinDomainOrWorkgroup Windows 2000 Here is a script repository example using and LDAP call, you will just have to know the Distinguished Name (DN) http://www.microsoft.com/technet/scr....mspx?mfr=true -- Paul Bergson MVP - Directory Services MCTS, MCT, MCSE, MCSA, Security+, BS CSci 2008, 2003, 2000 (Early Achiever), NT4 http://www.pbbergs.com Please no e-mails, any questions should be posted in the NewsGroup This posting is provided "AS IS" with no warranties, and confers no rights. "DMc2007" <davidmcnaughton_1999@xxxxxx> wrote in message news:OaEyrsbkJHA.1184@xxxxxx Quote: > 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 > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: UnjoinDomainOrWorkgroup Windows 2000 "DMc2007" <davidmcnaughton_1999@xxxxxx> wrote in message news:OaEyrsbkJHA.1184@xxxxxx Quote: > 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 http://www.microsoft.com/technet/scr.../cptrvb19.mspx If you get an error, what is the error message and on which line is it raised? -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #4 (permalink) |
| | Re: UnjoinDomainOrWorkgroup Windows 2000 Hi, the link opens the window with the main script catergorys? Regards D "Paul Bergson [MVP-DS]" <pbbergs@xxxxxx_msn.com> wrote in message news:7B88F29B-310F-4CCB-BBD4-2ADAABB6966F@xxxxxx Quote: > Here is a script repository example using and LDAP call, you will just > have to know the Distinguished Name (DN) > http://www.microsoft.com/technet/scr....mspx?mfr=true > > -- > Paul Bergson > MVP - Directory Services > MCTS, MCT, MCSE, MCSA, Security+, BS CSci > 2008, 2003, 2000 (Early Achiever), NT4 > > http://www.pbbergs.com > > Please no e-mails, any questions should be posted in the NewsGroup This > posting is provided "AS IS" with no warranties, and confers no rights. > > > "DMc2007" <davidmcnaughton_1999@xxxxxx> wrote in message > news:OaEyrsbkJHA.1184@xxxxxx Quote: >> 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 >> |
My System Specs![]() |
| | #5 (permalink) |
| | Re: UnjoinDomainOrWorkgroup Windows 2000 Using on a Windows 2000 SP4 Domain workstation, on a Windows 2003 Domain. Code is below: Const NETSETUP_ACCT_DELETE = 2 'Disables computer account in domain. strPassword = "SW2009Feb10792-d" strUser = "SWCAMW" 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) Error message is as follows: Script: C:\Temp\DeleteFromDomain.vbs Line: 11 Char: 1 Error: Object doesn't support this property or method: 'objComputer.UnjoinDomainOrWorkGroup' Code: 800A01B6 Source: Microsoft VBScript runtime error. Kind Regards D "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in message news:e65wADekJHA.5836@xxxxxx Quote: > > "DMc2007" <davidmcnaughton_1999@xxxxxx> wrote in message > news:OaEyrsbkJHA.1184@xxxxxx Quote: >> 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 > Per this link it should work on Windows 2000 clients: > > http://www.microsoft.com/technet/scr.../cptrvb19.mspx > > If you get an error, what is the error message and on which line is it > raised? > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: UnjoinDomainOrWorkgroup Windows 2000 I've never used the UnjoinDomainOrWorkgroup method, but I just looked at my script that uses the JoinDomainOrWorkgroup method. I have this comment based on research I did some time ago: ' The computer must have XP or above. ' The AD must be W2k3 or above. ' See c:\Windows\debug\NetSetup.log for details. I would say the link I gave is incorrect. The client must be XP or above (unless someone knows how to upgrade WMI to support the method). -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- "DMc2007" <davidmcnaughton_1999@xxxxxx> wrote in message news:u2eW%23TekJHA.6124@xxxxxx Quote: > Using on a Windows 2000 SP4 Domain workstation, on a Windows 2003 Domain. > > Code is below: > > Const NETSETUP_ACCT_DELETE = 2 'Disables computer account in domain. > strPassword = "SW2009Feb10792-d" > strUser = "SWCAMW" > > 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) > > Error message is as follows: > > Script: C:\Temp\DeleteFromDomain.vbs > Line: 11 > Char: 1 > Error: Object doesn't support this property or method: > 'objComputer.UnjoinDomainOrWorkGroup' > Code: 800A01B6 > Source: Microsoft VBScript runtime error. > > Kind Regards > > D > > > "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in > message news:e65wADekJHA.5836@xxxxxx Quote: >> >> "DMc2007" <davidmcnaughton_1999@xxxxxx> wrote in message >> news:OaEyrsbkJHA.1184@xxxxxx Quote: >>> 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 >> Per this link it should work on Windows 2000 clients: >> >> http://www.microsoft.com/technet/scr.../cptrvb19.mspx >> >> If you get an error, what is the error message and on which line is it >> raised? >> >> -- >> Richard Mueller >> MVP Directory Services >> Hilltop Lab - http://www.rlmueller.net >> -- >> >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Vista to 2000, 2000 has shared folder | Vista networking & sharing | |||
| Install Windows 2000 on Windows Vista Home OEM machine multi boot | Vista installation & setup | |||
| Problemas con Windows Vista Business SP1 en un dominio Windows Server 2000 | Vista security | |||
| Windows vista, suported joing in domain Windows server 2000??? | Vista networking & sharing | |||
| from windows 2000 to vista basic if prob with 2000? | Vista General | |||