RebootAll_ST is not working

Posted on 2006-07-14
Last Modified: 2010-04-23
I am not a programmer.  I have the task of doing remote reboots of all the workstations in my domain and needed a tool that would work simply for me.  I downloaded your tool and I believe I edited the script properly but the tool runs and doesn't rebbot any of the workstations in the OU.  I need to be ready for this tomorrow as we have scheduled a Domain rename.  This is of course Windows 2K3 AD.  There is nothing in the log file either.  There were no instructions as to exactly how to edit the vb script files.

Can you help???  
Question by:heqarota
LVL 41

Accepted Solution

graye earned 500 total points
ID: 17107911
Hummm... RebootAll_ST isn't a vb script.  It's Visual Basic .Net 2003 source code.

That means that you (or someone in your organization) will have to use Microsoft Visual Studio to compile the source code into a usable program that will run on your computer.  Luckily, Microsoft provides the Visual Basic 2005 Express Edition as a free download at

After compiling, you just edit the *.config file (with notepad or any other text editor) to change the parameters to suit your needs.  The parameters are fairly straight forward:

DOMAIN - The name of your AD domain
OU - a "filter" (if required) that limits the scope to a particular OU
FILTER - a "name filter" (if required) to select only PCs that match a pattern
EXCEPTION_LIST - the path to an text file that contains a list of PCs (one per line) to exclude
LOG_FILE - the path to a file that will contain the log of what's happening
LOG_LEVEL - How much detail goes in the log
LIST_METHOD - for you, it'd be "AD_Doman"

If you need a VBScript version, here is something that will do almost the same thing as the RebootAll_ST program.  It will require some editing to meet your needs (server, share, and domain names)

Dim objs, obj
Dim wsh, Cmd, i, buf, ComputerName
dim fso, ts, exclude(100), skip, list
dim MyName

' get a list of PCs that you want to exclude
set fso = createobject("Scripting.FileSystemObject")
list = 0
if fso.fileexists("\\SomeServer\SomeShare\Reboot_Exceptions.txt") then
      set ts = fso.OpenTextFile("\\SomeServer\SomeShare\Reboot_Exceptions.txt", 1)
      do while not ts.atendofstream
            exclude(list) = ts.readline
            list = list +1
end if

' find out our computer name (we don't want to reboot ourselves!)
' let's make sure this is one of our PCs!
Set objs = GetObject("winmgmts:").InstancesOf("Win32_ComputerSystem")
for each obj in objs
      myname =
      exit for

' execute the "Net View" command
Set wsh = CreateObject("WScript.Shell")
set Cmd = wsh.Exec("Net View /Domain:YourDomain")
wscript.sleep 1000

' read the output and parse the computer names
do while Not Cmd.StdOut.AtEndOfStream
      buf = cmd.stdout.readline
      if left(buf, 2) = "\\" then
            i = instr(buf, " ")
            ComputerName = mid(buf, 3, i-3)
            ' check to see if we should exclude this PC
            skip = false
            for i = 0 to list -1
                  if ucase(computername) = ucase(exclude(i)) then
                        skip = true
                        exit for
                  end if
            ' make sure to skip me!
            if computername = myname then
                  skip = true
            end if
            if not skip then
                  reboot computername
            end if
      end if

sub reboot(computername)
      ' ignore errors (already logged off, not Win2k, etc)
      on error resume next
      Set objs = GetObject("WinMgmts://" & computername & "/root/cimv2").InstancesOf("Win32_OperatingSystem")
      for each obj in objs
      set objs = nothing
      on error goto 0
end sub

Author Comment

ID: 17109477
Thanks so much for your help.  As I said before, I'm no programmer and have'nt touched any code in years.  I think both solutions are excellent.  I have downloaded VB and am attempting to compile the code now.  

Thanks again

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question