|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how do I disjoin a machine to workgroup namehow do I modify the below to join a workgroup name "workgroup" instead of
the domain name? 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 (NULL,NULL,0) First, is the computer currently a domain member, not a workgroup member? If
so - and only if so - you first need to use the UnjoinDomainOrWorkgroup the way you have it. The second step is to use JoinDomainOrWorkgroup, like this: objComputer.JoinDomainOrWorkgroup("workgroup") you have the necessary privileges, don't bother with arguments Show quoteHide quote "Joey" <j***@joey.com> wrote in message news:eIAv$aQzJHA.1372@TK2MSFTNGP05.phx.gbl... > how do I modify the below to join a workgroup name "workgroup" instead of > the domain name? > > 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 (NULL,NULL,0) > ok
how do I add a line that will kill all processes ? 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 (NULL,NULL,0) intReturn1 = objComputer.JoinDomainOrWorkgroup("workgroup") Set OpSysSet = GetObject("winmgmts:{(Shutdown)}!\\.\root\cimv2").ExecQuery _ ("select * from Win32_OperatingSystem where Primary=true") for each OpSys in OpSysSet OpSys.Reboot() next Show quoteHide quote "Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message news:%23cOJpgZzJHA.6004@TK2MSFTNGP02.phx.gbl... > First, is the computer currently a domain member, not a workgroup member? > If so - and only if so - you first need to use the UnjoinDomainOrWorkgroup > the way you have it. > > The second step is to use JoinDomainOrWorkgroup, like this: > > objComputer.JoinDomainOrWorkgroup("workgroup") > > > you have the necessary privileges, don't bother with arguments > > "Joey" <j***@joey.com> wrote in message > news:eIAv$aQzJHA.1372@TK2MSFTNGP05.phx.gbl... >> how do I modify the below to join a workgroup name "workgroup" instead of >> the domain name? >> >> 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 (NULL,NULL,0) >> Since you're using the Reboot() method, that will happen automatically. Are
you running into problems with making this work in a specific situation? Show quoteHide quote "Joey" <j***@joey.com> wrote in message news:euFxo9nzJHA.1492@TK2MSFTNGP04.phx.gbl... > ok > > how do I add a line that will kill all processes ? > > 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 (NULL,NULL,0) > intReturn1 = objComputer.JoinDomainOrWorkgroup("workgroup") > > > Set OpSysSet = GetObject("winmgmts:{(Shutdown)}!\\.\root\cimv2").ExecQuery > _ > ("select * from Win32_OperatingSystem where Primary=true") > > for each OpSys in OpSysSet > OpSys.Reboot() > next > > > > "Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message > news:%23cOJpgZzJHA.6004@TK2MSFTNGP02.phx.gbl... >> First, is the computer currently a domain member, not a workgroup member? >> If so - and only if so - you first need to use the >> UnjoinDomainOrWorkgroup the way you have it. >> >> The second step is to use JoinDomainOrWorkgroup, like this: >> >> objComputer.JoinDomainOrWorkgroup("workgroup") >> >> >> you have the necessary privileges, don't bother with arguments >> >> "Joey" <j***@joey.com> wrote in message >> news:eIAv$aQzJHA.1372@TK2MSFTNGP05.phx.gbl... >>> how do I modify the below to join a workgroup name "workgroup" instead >>> of the domain name? >>> >>> 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 (NULL,NULL,0) >>> > > yes after joining the domain, there isa process that keeps hanging and
waiting for a "end now". I want to be able to kill that process and then reboot Show quoteHide quote "Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com> wrote in message news:upPFJc0zJHA.5032@TK2MSFTNGP05.phx.gbl... > Since you're using the Reboot() method, that will happen automatically. > Are you running into problems with making this work in a specific > situation? > > "Joey" <j***@joey.com> wrote in message > news:euFxo9nzJHA.1492@TK2MSFTNGP04.phx.gbl... >> ok >> >> how do I add a line that will kill all processes ? >> >> 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 (NULL,NULL,0) >> intReturn1 = objComputer.JoinDomainOrWorkgroup("workgroup") >> >> >> Set OpSysSet = >> GetObject("winmgmts:{(Shutdown)}!\\.\root\cimv2").ExecQuery _ >> ("select * from Win32_OperatingSystem where Primary=true") >> >> for each OpSys in OpSysSet >> OpSys.Reboot() >> next >> >> >> >> "Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message >> news:%23cOJpgZzJHA.6004@TK2MSFTNGP02.phx.gbl... >>> First, is the computer currently a domain member, not a workgroup >>> member? If so - and only if so - you first need to use the >>> UnjoinDomainOrWorkgroup the way you have it. >>> >>> The second step is to use JoinDomainOrWorkgroup, like this: >>> >>> objComputer.JoinDomainOrWorkgroup("workgroup") >>> >>> >>> you have the necessary privileges, don't bother with arguments >>> >>> "Joey" <j***@joey.com> wrote in message >>> news:eIAv$aQzJHA.1372@TK2MSFTNGP05.phx.gbl... >>>> how do I modify the below to join a workgroup name "workgroup" instead >>>> of the domain name? >>>> >>>> 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 (NULL,NULL,0) >>>> >> >> Instead of using Win32_OperatingSystem's Reboot() method, you're probably
better off using its Win32Shutdown; this allows you forced shutdown (trying to kill all processes isn't going to work - it will kill your own script as well, and some processes won't be touched). You want to specify restart + forcing, which is a value of 6 if you check the online documentation for the method: http://msdn.microsoft.com/en-us/library/aa394058%28VS.85%29.aspx so use it like this: OpSys.Win32Shutdown( 6, 0) Show quoteHide quote "Joey" <j***@joey.com> wrote in message news:#A$bDIQ0JHA.2300@TK2MSFTNGP06.phx.gbl... > yes after joining the domain, there isa process that keeps hanging and > waiting for a "end now". I want to be able to kill that process and then > reboot > > "Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com> > wrote in message news:upPFJc0zJHA.5032@TK2MSFTNGP05.phx.gbl... >> Since you're using the Reboot() method, that will happen automatically. >> Are you running into problems with making this work in a specific >> situation? >> >> "Joey" <j***@joey.com> wrote in message >> news:euFxo9nzJHA.1492@TK2MSFTNGP04.phx.gbl... >>> ok >>> >>> how do I add a line that will kill all processes ? >>> >>> 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 (NULL,NULL,0) >>> intReturn1 = objComputer.JoinDomainOrWorkgroup("workgroup") >>> >>> >>> Set OpSysSet = >>> GetObject("winmgmts:{(Shutdown)}!\\.\root\cimv2").ExecQuery _ >>> ("select * from Win32_OperatingSystem where Primary=true") >>> >>> for each OpSys in OpSysSet >>> OpSys.Reboot() >>> next >>> >>> >>> >>> "Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message >>> news:%23cOJpgZzJHA.6004@TK2MSFTNGP02.phx.gbl... >>>> First, is the computer currently a domain member, not a workgroup >>>> member? If so - and only if so - you first need to use the >>>> UnjoinDomainOrWorkgroup the way you have it. >>>> >>>> The second step is to use JoinDomainOrWorkgroup, like this: >>>> >>>> objComputer.JoinDomainOrWorkgroup("workgroup") >>>> >>>> >>>> you have the necessary privileges, don't bother with arguments >>>> >>>> "Joey" <j***@joey.com> wrote in message >>>> news:eIAv$aQzJHA.1372@TK2MSFTNGP05.phx.gbl... >>>>> how do I modify the below to join a workgroup name "workgroup" instead >>>>> of the domain name? >>>>> >>>>> 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 (NULL,NULL,0) >>>>> >>> >>> > > it says cannot use parenthesus when calling a Sub
Show quoteHide quote "Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com> wrote in message news:%23e5cSHb0JHA.3408@TK2MSFTNGP04.phx.gbl... > Instead of using Win32_OperatingSystem's Reboot() method, you're probably > better off using its Win32Shutdown; this allows you forced shutdown > (trying to kill all processes isn't going to work - it will kill your own > script as well, and some processes won't be touched). > > You want to specify restart + forcing, which is a value of 6 if you check > the online documentation for the method: > > http://msdn.microsoft.com/en-us/library/aa394058%28VS.85%29.aspx > > so use it like this: > OpSys.Win32Shutdown( 6, 0) > > > "Joey" <j***@joey.com> wrote in message > news:#A$bDIQ0JHA.2300@TK2MSFTNGP06.phx.gbl... >> yes after joining the domain, there isa process that keeps hanging and >> waiting for a "end now". I want to be able to kill that process and then >> reboot >> >> "Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com> >> wrote in message news:upPFJc0zJHA.5032@TK2MSFTNGP05.phx.gbl... >>> Since you're using the Reboot() method, that will happen automatically. >>> Are you running into problems with making this work in a specific >>> situation? >>> >>> "Joey" <j***@joey.com> wrote in message >>> news:euFxo9nzJHA.1492@TK2MSFTNGP04.phx.gbl... >>>> ok >>>> >>>> how do I add a line that will kill all processes ? >>>> >>>> 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 (NULL,NULL,0) >>>> intReturn1 = objComputer.JoinDomainOrWorkgroup("workgroup") >>>> >>>> >>>> Set OpSysSet = >>>> GetObject("winmgmts:{(Shutdown)}!\\.\root\cimv2").ExecQuery _ >>>> ("select * from Win32_OperatingSystem where Primary=true") >>>> >>>> for each OpSys in OpSysSet >>>> OpSys.Reboot() >>>> next >>>> >>>> >>>> >>>> "Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message >>>> news:%23cOJpgZzJHA.6004@TK2MSFTNGP02.phx.gbl... >>>>> First, is the computer currently a domain member, not a workgroup >>>>> member? If so - and only if so - you first need to use the >>>>> UnjoinDomainOrWorkgroup the way you have it. >>>>> >>>>> The second step is to use JoinDomainOrWorkgroup, like this: >>>>> >>>>> objComputer.JoinDomainOrWorkgroup("workgroup") >>>>> >>>>> >>>>> you have the necessary privileges, don't bother with arguments >>>>> >>>>> "Joey" <j***@joey.com> wrote in message >>>>> news:eIAv$aQzJHA.1372@TK2MSFTNGP05.phx.gbl... >>>>>> how do I modify the below to join a workgroup name "workgroup" >>>>>> instead of the domain name? >>>>>> >>>>>> 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 (NULL,NULL,0) >>>>>> >>>> >>>> >> >> Ah, you're not capturing the return value. Do so, and that fixes the
problem: intRtn = OpSys.Win32Shutdown( 6, 0) alternatively, if you don't want to check the return value, just don't use the parentheses. VBScript has weird syntax requirements: OpSys.Win32Shutdown 6, 0 Show quoteHide quote "Joey" <j***@joey.com> wrote in message news:OvCTsIm0JHA.2656@TK2MSFTNGP05.phx.gbl... > it says cannot use parenthesus when calling a Sub > > "Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com> > wrote in message news:%23e5cSHb0JHA.3408@TK2MSFTNGP04.phx.gbl... >> Instead of using Win32_OperatingSystem's Reboot() method, you're probably >> better off using its Win32Shutdown; this allows you forced shutdown >> (trying to kill all processes isn't going to work - it will kill your own >> script as well, and some processes won't be touched). >> >> You want to specify restart + forcing, which is a value of 6 if you check >> the online documentation for the method: >> >> http://msdn.microsoft.com/en-us/library/aa394058%28VS.85%29.aspx >> >> so use it like this: >> OpSys.Win32Shutdown( 6, 0) >> >> >> "Joey" <j***@joey.com> wrote in message >> news:#A$bDIQ0JHA.2300@TK2MSFTNGP06.phx.gbl... >>> yes after joining the domain, there isa process that keeps hanging and >>> waiting for a "end now". I want to be able to kill that process and then >>> reboot >>> >>> "Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com> >>> wrote in message news:upPFJc0zJHA.5032@TK2MSFTNGP05.phx.gbl... >>>> Since you're using the Reboot() method, that will happen automatically. >>>> Are you running into problems with making this work in a specific >>>> situation? >>>> >>>> "Joey" <j***@joey.com> wrote in message >>>> news:euFxo9nzJHA.1492@TK2MSFTNGP04.phx.gbl... >>>>> ok >>>>> >>>>> how do I add a line that will kill all processes ? >>>>> >>>>> 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 (NULL,NULL,0) >>>>> intReturn1 = objComputer.JoinDomainOrWorkgroup("workgroup") >>>>> >>>>> >>>>> Set OpSysSet = >>>>> GetObject("winmgmts:{(Shutdown)}!\\.\root\cimv2").ExecQuery _ >>>>> ("select * from Win32_OperatingSystem where Primary=true") >>>>> >>>>> for each OpSys in OpSysSet >>>>> OpSys.Reboot() >>>>> next >>>>> >>>>> >>>>> >>>>> "Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message >>>>> news:%23cOJpgZzJHA.6004@TK2MSFTNGP02.phx.gbl... >>>>>> First, is the computer currently a domain member, not a workgroup >>>>>> member? If so - and only if so - you first need to use the >>>>>> UnjoinDomainOrWorkgroup the way you have it. >>>>>> >>>>>> The second step is to use JoinDomainOrWorkgroup, like this: >>>>>> >>>>>> objComputer.JoinDomainOrWorkgroup("workgroup") >>>>>> >>>>>> >>>>>> you have the necessary privileges, don't bother with arguments >>>>>> >>>>>> "Joey" <j***@joey.com> wrote in message >>>>>> news:eIAv$aQzJHA.1372@TK2MSFTNGP05.phx.gbl... >>>>>>> how do I modify the below to join a workgroup name "workgroup" >>>>>>> instead of the domain name? >>>>>>> >>>>>>> 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 (NULL,NULL,0) >>>>>>> >>>>> >>>>> >>> >>> > > thank you very much
Show quoteHide quote "Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com> wrote in message news:ujAi9Xn0JHA.1900@TK2MSFTNGP04.phx.gbl... > Ah, you're not capturing the return value. Do so, and that fixes the > problem: > > intRtn = OpSys.Win32Shutdown( 6, 0) > > alternatively, if you don't want to check the return value, just don't use > the parentheses. VBScript has weird syntax requirements: > > OpSys.Win32Shutdown 6, 0 > > "Joey" <j***@joey.com> wrote in message > news:OvCTsIm0JHA.2656@TK2MSFTNGP05.phx.gbl... >> it says cannot use parenthesus when calling a Sub >> >> "Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com> >> wrote in message news:%23e5cSHb0JHA.3408@TK2MSFTNGP04.phx.gbl... >>> Instead of using Win32_OperatingSystem's Reboot() method, you're >>> probably better off using its Win32Shutdown; this allows you forced >>> shutdown (trying to kill all processes isn't going to work - it will >>> kill your own script as well, and some processes won't be touched). >>> >>> You want to specify restart + forcing, which is a value of 6 if you >>> check the online documentation for the method: >>> >>> http://msdn.microsoft.com/en-us/library/aa394058%28VS.85%29.aspx >>> >>> so use it like this: >>> OpSys.Win32Shutdown( 6, 0) >>> >>> >>> "Joey" <j***@joey.com> wrote in message >>> news:#A$bDIQ0JHA.2300@TK2MSFTNGP06.phx.gbl... >>>> yes after joining the domain, there isa process that keeps hanging and >>>> waiting for a "end now". I want to be able to kill that process and >>>> then reboot >>>> >>>> "Alex K. Angelopoulos" <alex(dot) k(dot >>>> again)angelopoulos(at)gmail.com> wrote in message >>>> news:upPFJc0zJHA.5032@TK2MSFTNGP05.phx.gbl... >>>>> Since you're using the Reboot() method, that will happen >>>>> automatically. Are you running into problems with making this work in >>>>> a specific situation? >>>>> >>>>> "Joey" <j***@joey.com> wrote in message >>>>> news:euFxo9nzJHA.1492@TK2MSFTNGP04.phx.gbl... >>>>>> ok >>>>>> >>>>>> how do I add a line that will kill all processes ? >>>>>> >>>>>> 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 (NULL,NULL,0) >>>>>> intReturn1 = objComputer.JoinDomainOrWorkgroup("workgroup") >>>>>> >>>>>> >>>>>> Set OpSysSet = >>>>>> GetObject("winmgmts:{(Shutdown)}!\\.\root\cimv2").ExecQuery _ >>>>>> ("select * from Win32_OperatingSystem where Primary=true") >>>>>> >>>>>> for each OpSys in OpSysSet >>>>>> OpSys.Reboot() >>>>>> next >>>>>> >>>>>> >>>>>> >>>>>> "Alex K. Angelopoulos" <aka(at)mvps.org> wrote in message >>>>>> news:%23cOJpgZzJHA.6004@TK2MSFTNGP02.phx.gbl... >>>>>>> First, is the computer currently a domain member, not a workgroup >>>>>>> member? If so - and only if so - you first need to use the >>>>>>> UnjoinDomainOrWorkgroup the way you have it. >>>>>>> >>>>>>> The second step is to use JoinDomainOrWorkgroup, like this: >>>>>>> >>>>>>> objComputer.JoinDomainOrWorkgroup("workgroup") >>>>>>> >>>>>>> >>>>>>> you have the necessary privileges, don't bother with arguments >>>>>>> >>>>>>> "Joey" <j***@joey.com> wrote in message >>>>>>> news:eIAv$aQzJHA.1372@TK2MSFTNGP05.phx.gbl... >>>>>>>> how do I modify the below to join a workgroup name "workgroup" >>>>>>>> instead of the domain name? >>>>>>>> >>>>>>>> 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 (NULL,NULL,0) >>>>>>>> >>>>>> >>>>>> >>>> >>>> >> >>
Set Local Computer Description
Use VBScript to Set Local Computer Description Inventory script question How do implement this wildcard? Logon script help Get computer name as variable to use in vbs script. Issues when launching a vbscript file from hta interface file Re: Updating AD with a script convert vb script to exe anyone know if this is possible? |
|||||||||||||||||||||||