Solved

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

Posted on 2008-10-13
4
517 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
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
Brum07 earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Welcome to part one of a multi-part tutorial series, VBScript for Windows System Administrators.  The goal of this series is to teach non-programmers how to write useful VBS code to automate their environment, and perform tasks faster, and in a more…
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now