Solved

Need a VBScript to shutdown all computers in one OU without affecting Sub OU's

Posted on 2008-10-13
4
560 Views
Last Modified: 2012-05-05
I need a VBScript which will shutdown all servers in ONE OU without affecting the sub OU's in the OU I need to target.  Many, many thanks in advance!
0
Comment
Question by:prgriffin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
Brum07 earned 500 total points
ID: 22702583
Try this;

http://www.wisesoft.co.uk/Scripts/vbscript_shutdown_all_computers_in_an_organizational_unit.aspx

You can use the onlevel paramerter to only use the specified OU

Regards
0
 

Author Comment

by:prgriffin
ID: 22703131
I have tried this one, but this also hits the Sub OU below it, for some reason.  What adjustments do I need to make to this script so it will only shutdown machines in the one OU?  Many Thanks!
0
 
LVL 13

Assisted Solution

by:Brum07
Brum07 earned 500 total points
ID: 22703237
Try using this code;

http://www.visualbasicscript.com/m_33646/tm.htm

with the shutdown subroutine instead of the objFile.Write

Regards
0
 

Author Comment

by:prgriffin
ID: 22704959
Actually walked away for a while and looked at that script again.  Did some good; the stupid answer was staring me right in the face the whole time.  Just changed one setting from "subtree" to "onelevel" and that worked!  Thanks again!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

707 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