Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-10-13
4
Medium Priority
?
573 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 2000 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 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