?
Solved

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

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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
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…

743 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