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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Single Form 8 42
Help with Syntax 9 36
VB: Convert 2 dates to specific format 24 48
VB.Net - Get ColumnNames of SQL Table 4 10
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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