Announcement

Collapse
No announcement yet.

Scripting Automatic Restart

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scripting Automatic Restart

    Hi there,
    I am trying to reboot all pcs in a certain OU by running a script.

    I read the following post:

    http://forums.petri.com/showthread.php?t=17592

    There are a few things that are not clear to me.

    Is this a VBscript or bat file? Does the psshutdown.exe have to be in the same directory? I guess my question is with that script what are all the step by step procedures.

    I took the script in the link about and I edited the search parameters to

    strContainer = "ou=test"

    and I commented out
    objShell.Run "psshutdown.exe \\" & strComputer & " -k -f - r -t 10"

    I ran the script in both vbs and bat

    All help would be greatly appreciated.

    Thanks In Advance

  • #2
    Re: Scripting Automatic Restart

    Originally posted by adauser View Post
    Which of the scripts shown there?

    Originally posted by adauser View Post
    Is this a VBscript or bat file?
    It is VBS, judging by the commands you wrote.

    Originally posted by adauser View Post
    Does the psshutdown.exe have to be in the same directory?
    Absolutely. If not, you will need to write the full path to the EXE.

    Originally posted by adauser View Post
    I took the script in the link about and I edited the search parameters to
    strContainer = "ou=test"
    and I commented out
    objShell.Run "psshutdown.exe \\" & strComputer & " -k -f - r -t 10"
    By doing that you don't run the command, so what did you expect?
    Originally posted by adauser View Post
    I ran the script in both vbs and bat
    And what was the result? After you commented the command out, probably nothing?

    Originally posted by adauser View Post
    All help would be greatly appreciated.
    What is the question?

    So, please start from the beginning and try to be more clear about what you try to achieve (although this is pretty clear), what did you use in your test, what was the output and what is the question.
    The forum rules can help a lot.

    I'm looking forward for your answers.

    Sorin Solomon


    In order to succeed, your desire for success should be greater than your fear of failure.
    -

    Comment


    • #3
      Re: Scripting Automatic Restart

      adauser,
      Two more questions,
      what is the OS on the computer you want to run the script from (this can be any computer server or client from an other OU)?
      Is the OS on all the clients the same - all Windows XP?

      Just for testing, replace the line;
      objShell.Run "psshutdown.exe \\" & strComputer & " -k -f - r -t 10"
      with;
      wscript.echo "Found Computer:", strComputer
      Now the script is just showing you the computernames found in the test OU, instead of trying to connect to the computers and rebooting them.

      The account that runs the script must have remote shutdown privilege on the clients, you can use an account that is member of the Domain Admins group. This groupt is by default member op the local group Administrators on each client.
      If you want, it is also possible to ajust the script so it can also accept alternate credentials from the command line.

      p.s.
      Instead of using the tool psshutdown.exe, you can also send a "Reboot+force" to the computers just bij using vbs code. That would make the script portable, and probably it runs faster too.



      \Rems

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment

      Working...
      X