Solved

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

Posted on 2008-10-13
4
554 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

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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