By David Wiseman (Administrator)Created 16 Mar 2008, Modified 17 Mar 2008
My Rating:
Vote
Rating:
Not Rated
Views:15934
Downloads:578

Shutdown All Computers in an Organizational Unit (OU)

Language:  VBScript

Compatibility

Windows XP Yes Windows 2003 Yes
Windows 2000 Unknown Windows NT Unknown
Vista Unknown Windows 2008 Unknown
Description

This script will shutdown all computers in an organizational unit (or any ldap filter you specify). Please use this script with extreme caution.


Notes
This script is designed to run in CSCRIPT mode. Open a command prompt and type the following command: CSCRIPT shutdowncomputers.vbs 
Code

Line Numbers: On  Off      Plain Text
OPTION Explicit
DIM cn,cmd,rs
DIM objRoot
DIM strRoot, strFilter, strScope

' *******************************************************************
' * Setup
' *******************************************************************
' Specify OU of computers you want to shutdown
strRoot = "cn=computers,dc=wisesoft,dc=org,dc=uk"
' Default filter for computer objects
' You might want to use a different filter.  By operating system for example:
' (&(objectCategory=Computer)(operatingSystem=Windows XP*))
strFilter = "(objectCategory=Computer)"
' Search child organizational units.  Use "onelevel" to search only the specified OU.
strScope = "subtree"

' *******************************************************************

set cmd = createobject("ADODB.Command")
set cn = createobject("ADODB.Connection")
set rs = createobject("ADODB.Recordset")

cn.open "Provider=ADsDSOObject;"
cmd.activeconnection = cn

cmd.commandtext = "<LDAP://" & strRoot & ">;" & strFilter & ";" & _
		  "name;" & strScope
'**** Bypass 1000 record limitation ****
cmd.properties("page size")=1000

set rs = cmd.execute

while rs.eof <> true and rs.bof <> true
	wscript.echo "Shutting Down " & rs("name") & "..."
	ShutDownComputer(rs("name"))

	rs.movenext
wend

cn.close

' Subroutine to shutdown a computer
private sub ShutDownComputer(byval strComputer)
	dim strShutDown,objShell
	
	' -s = shutdown, -t 60 = 60 second timeout, -f = force programs to close
	strShutdown = "shutdown.exe -s -t 60 -f -m \\" & strComputer

    	set objShell = CreateObject("WScript.Shell") 

    	objShell.Run strShutdown, 0, false

end sub	

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      

Posted On: 9/28/2018 7:26:40 AM

jinyi928 pandora charms moncler outlet ugg boots outlet longchamp basketballl shoes adidas shoes bottega veneta mbt shoes supreme clothing coach outlet lacoste polo coach outlet christmas presents off white jordan adidas nmd longchamp outlet canada goose outlet canada goose outlet louboutin shoes canadian goose clarks outlet michael kors outlet skechers shoes new balance shoes canada goose moncler outlet coach outlet true religion salomon shoes off white shoes clarks outlet james harden shoes ray ban sunglasses ralph lauren polo pandora champion sportswear tory burch outlet coach outlet kate spade outlet michael kors outlet mlb jerseys nike tn ralph lauren polo oakley sunglasses true religion jeans champion clothing christian louboutin outlet christian louboutin shoes adidas superstar clarks shoes ralph lauren polo red bottom shoes pandora jewelry ralph lauren uk red bottom shoes moncler outlet canada goose jackets coach outlet coach outlet online canada goose outlet coach outlet converse trainer ecco shoes nike outlet superdry uk coach outlet online ugg outlet clearance canada goose outlet kate spade handbags adidas yeezy coach outlet jordan uk canada goose jacket hermes belt hogan shoes jordans ray ban sunglasses supreme ray ban sunglasses ray ban sunglasses true religion jeans outlet north face coach handbags ugg boots off white clothing canada goose ralph lauren polo christian louboutin shoes ralph lauren uk canada goose clothing coach outlet ugg outlet boots coach factory outlet air max 90 christian louboutin outlet christian louboutin off white outlet ugg outlet jordan shoes pandora charms asics shoes nike shoes outlet christian louboutin outlet moncler jackets ed hardy uk fitflops clearance ugg boots christian louboutin outlet michael kors outlet canada goose outlet pandora outlet tod's outlet manolo blahnik canada goose outlet red bottom shoes nike shoes salomon shoes nike blazers coach outlet dsquared2 ralph lauren fitflops clearance north face true religion jeans canada goose jackets pandora jewelry true religion jeans outlet jordans louboutin shoes asics shoes coach outlet nhl jersey jordan clothing yeezy boots 350 nike shoes nike shoes coach outlet online nike outlet factory jordan 8 fitflops clearance ralph lauren polo jordan shoes canada goose outlet jordan 4 adidas yeezy giuseppe zanotti kate spade outlet true religion canada goose nike clothing louboutin shoes nike air max mbt shoes issey miyake ferragamo belt air max 90 ultra boost 3.0 birken stock moncler outlet ugg boots canada goose outlet moncler outlet moncler jackets hogan shoes coach factory outlet louboutin shoes stussy ugg boots clearance true religion jeans soccer shoes pandora outlet pandora charms ugg boots ecco shoes canada goose outlet kate spade outlet jordan shoes nba jerseys reebok outlet adidas clothing louboutin shoes michael kors outlet fitflops clearance adidas clothing vibram five fingers coach outlet ray ban sunglasses nike shoes fidget spinner ralph lauren polo christian louboutin pandora jewelry coach outlet online pandora charms clarks shoes christian louboutin coach outlet coach outlet factory coach outlet kate spade outlet moncler jacket ugg outlet canada goose outlet mbt shoes ugg outlet ferragamo shoes valentino shoes red bottom shoes christian louboutin shoes pandora outlet prada handbags ralph lauren polo moncler outlet coach factory outlet coach outlet christian louboutin shoes kate spade outlet michael kors outlet ralph lauren polo longchamp outlet ralph lauren uk hermes belt coach outlet adidas outlet hugo boss kate spade nike shoes canada goose outlet hugo boss louboutin shoes jordan shoes prada shoes ugg boots clearance christian louboutin outlet supreme clothing ugg outlet air max 90 dsquared2 christian louboutin outlet christian louboutin nike huarache coach factory outlet

qzyfffff
Posted On: 1/12/2019 8:25:40 AM

offwhite yeezy boost 350 yeezy 500 vans outlet replica rolex jordans balenciaga adidas shoes jordan 6 adidas ultra boost westbrook shoes adidas tubular shadow chrome hearts nike flyknit racer michael kors outlet nfl jerseys cheap nba jerseys off white shoes jordan shoes michael kors handbags balenciaga fila nike air max 2018 fila shoes cheap nfl jerseys nike air max 2017 adidas yeezy fila disruptor nike air huarache curry 4 shoes golden goose outlet golden goose fila nike hyperdunk hermes handbags bag yeezy hermes handbags for sale goyard crazy explosive coach handbags nike sneakers for men kyrie irving shoes pandora bracelet off white fake rolex michael kors handbags kobe sneakers moncler jackets cheap jordans nike react yeezy boost 350 golden goose outlet adidas tubular nike kd 11 nike react louboutin shoes balenciaga triple s yeezy boost 350 v2 yeezy boost 350 v2 adidas shoes outlet off white clothing jordan shoes adidas stan smith sneakers adidas nmd r1 lebron 16 nike flyknit nike polo shirts kd shoes kd 11 lebron 16 shoes nike cortez men nfl store red bottoms hermes handbags lebron 16 shoes james harden shoes yeezy boost 350 golden goose outlet michael kors outlet online goyard bag air max 2019 adidas ultra boost uncaged lacoste online shop goyard handbags cat boots goyard bag balenciaga nike air max lebron 11 hermes belt michael kors handbags tory burch shoes nike huarache air max 270 hermes belts for men adidas tubular balenciaga shoes yeezy boost 350 coach outlet caterpillar boots adidas ultra boost fake rolex hogan outlet online golden goose kate spade handbags air jordan 4 yeezy shoes nike shoes red bottom shoes lacoste polo kd shoes lebron james shoes timberland outlet nike sneakers for women nike air max 90 yeezy shoes yeezy shoes curry 5 yeezy shoes adidas nmd off white adidas yeezy kobe shoes off white nike ultra boost fila shoes yeezy shoes fitflops gucci belt yeezy nhl jerseys timberland boots yeezy kd shoes yeezy boost 350 nike epic react hermes belt hermes birkin golden goose sneakers nike vapormax kevin durant shoes adidas zx flux adidas pure boost yeezy boost polo ralph lauren air jordan supreme hoodie valentino shoes nike cortez nike lebron 16 kd 11 shoes asics shoes vapormax jimmy choo shoes chrome hearts coach factory outlet kobe byrant shoes birkin bag adidas stan smith michael kors outlet online michael kors nike air max 2019 nike polo nike shox nike roshe run lacoste outlet adidas crazy explosive michael kors handbags fila shoes goyard handbags mbt shoes curry 4 jordan shoes mbt shoes online coach outlet online fila sneakers off white hoodie yeezy boost 350 v2 calvin klein outlet yeezys cheap jordans adidas tubular longchamp outlet basketball shoes kyrie 3 retro jordans links of london yeezy boost 350 michael kors purses yeezy boost lacoste outlet adidas gazelle yeezy boost 700 air yeezy chrome hearts online curry 4 lebron shoes asics running shoes goyard handbags nike foamposite coach outlet sale air max 2018 hermes belt kyrie 4 shoes jordan retro 6 adidas superstars goyard bags cheap nba jerseys hermes outlet online michael kors outlet air jordans russell westbrook shoes yeezy boost 350 v2 hermes bags jordan 12 lacoste polo shirts longchamp handbags fitflops sale clearance yeezys longchamp kd 10 birkin bag ralph lauren uk jordan 4 golden goose sneakers ysl handbags lacoste polo converse outlet store nike air max nmd valentino ysl longchamp bags converse outlet harden shoes adidas stan smith shoes adidas eqt support yeezy boost fila hogan outlet nike basketball shoes nike air max goyard canada goose jacket coach factory outlet yeezy boost paul george shoes nike epic react retro jordans iniki bape hoodie moncler jacket nike air max jordan shoes cheap mlb jerseys adidas yeezy adidas outlet online canada goose fila yeezy boost 350 air jordan curry 5 balenciaga shoes nike air max 270 stephen curry 5 golden goose nike roshe calvin klein outlet online michael kors outlet michael kors outlet online rolex replica bape hoodie ferragamo belt yeezy boost 350 michael jordan shoes michael kors handbags off white hoodie nike shox for men jordans red bottom heels coach outlet kobe 9 goyard bags ralph lauren uk nmd michael kors outlet hermes online shop jordan retro pure boost golden goose outlet adidas outlet balenciaga shoes fake rolex watches balenciaga sneakers nike air force 1 coach outlet chrome hearts online jordan shoes adidas iniki coach outlet yeezy boost gucci belts golden goose sneakers kd 11 stephen curry 5 nike huarache air jordan 13 birkin bag coach outlet sale goyard wallet michael kors handbags lebron shoes ferragamo belt vans shoes michael kors outlet jordan 13 adidas yeezy boost fila shoes ferragamo belts tory burch outlet nike sneakers kobe 9 lebron 10 yeezy boost 350 v2 lebron 16 adidas shoes online yeezy shoes yeezy boost 500 michael kors jordan 11 cheap jordans links of london outlet store nike max lebron 15 shoes supreme hoodie hermes handbags off white clothing goyard st louis tot reebok outlet air max 90 chrome hearts moncler jackets nike jordans jordan sneakers off white x jordan 1 golden goose sneakers yeezy boost golden goose michael kors factory outlet adidas stan smith nba jerseys coach outlet online adidas superstar golden goose tory burch off white shoes adidas yeezy tory burch sandals yeezy boost 350 yeezy 700 jordans lacoste adidas nmd kyrie 4 golden goose adidas nmd cheap jordans air force 1 yeezy boost kobe basketball shoes birkin bag golden goose outlet michael kors uk reebok shoes jordan 11 retro baseball jerseys 100% real jordans for cheap adidas nmd runner supreme clothing nike air force lebron 16 ferragamo belts louboutin shoes uk moncler outlet jordan retro 12 Kanye West shoes lebron 15 air max christian louboutin off white lacoste polo yeezy shoes michael kors handbags outlet zx flux yeezy boost 350 v2 pandora jewelry kobe 11 adidas eqt kyrie shoes adidas ultra kobe 11 off white clothing yeezy 500 mbt shoes outlet chrome hearts online kobe shoes off white jordan 1 michael kors outlet mlb jerseys

qzyfffff
Posted On: 1/12/2019 8:38:36 AM

offwhite yeezy boost 350 yeezy 500 vans outlet replica rolex jordans balenciaga adidas shoes jordan 6 adidas ultra boost westbrook shoes adidas tubular shadow chrome hearts nike flyknit racer michael kors outlet nfl jerseys cheap nba jerseys off white shoes jordan shoes michael kors handbags balenciaga fila nike air max 2018 fila shoes cheap nfl jerseys nike air max 2017 adidas yeezy fila disruptor nike air huarache curry 4 shoes golden goose outlet golden goose fila nike hyperdunk hermes handbags bag yeezy hermes handbags for sale goyard crazy explosive coach handbags nike sneakers for men kyrie irving shoes pandora bracelet off white fake rolex michael kors handbags kobe sneakers moncler jackets cheap jordans nike react yeezy boost 350 golden goose outlet adidas tubular nike kd 11 nike react louboutin shoes balenciaga triple s yeezy boost 350 v2 yeezy boost 350 v2 adidas shoes outlet off white clothing jordan shoes adidas stan smith sneakers adidas nmd r1 lebron 16 nike flyknit nike polo shirts kd shoes kd 11 lebron 16 shoes nike cortez men nfl store red bottoms hermes handbags lebron 16 shoes james harden shoes yeezy boost 350 golden goose outlet michael kors outlet online goyard bag air max 2019 adidas ultra boost uncaged lacoste online shop goyard handbags cat boots goyard bag balenciaga nike air max lebron 11 hermes belt michael kors handbags tory burch shoes nike huarache air max 270 hermes belts for men adidas tubular balenciaga shoes yeezy boost 350 coach outlet caterpillar boots adidas ultra boost fake rolex hogan outlet online golden goose kate spade handbags air jordan 4 yeezy shoes nike shoes red bottom shoes lacoste polo kd shoes lebron james shoes timberland outlet nike sneakers for women nike air max 90 yeezy shoes yeezy shoes curry 5 yeezy shoes adidas nmd off white adidas yeezy kobe shoes off white nike ultra boost fila shoes yeezy shoes fitflops gucci belt yeezy nhl jerseys timberland boots yeezy kd shoes yeezy boost 350 nike epic react hermes belt hermes birkin golden goose sneakers nike vapormax kevin durant shoes adidas zx flux adidas pure boost yeezy boost polo ralph lauren air jordan supreme hoodie valentino shoes nike cortez nike lebron 16 kd 11 shoes asics shoes vapormax jimmy choo shoes chrome hearts coach factory outlet kobe byrant shoes birkin bag adidas stan smith michael kors outlet online michael kors nike air max 2019 nike polo nike shox nike roshe run lacoste outlet adidas crazy explosive michael kors handbags fila shoes goyard handbags mbt shoes curry 4 jordan shoes mbt shoes online coach outlet online fila sneakers off white hoodie yeezy boost 350 v2 calvin klein outlet yeezys cheap jordans adidas tubular longchamp outlet basketball shoes kyrie 3 retro jordans links of london yeezy boost 350 michael kors purses yeezy boost lacoste outlet adidas gazelle yeezy boost 700 air yeezy chrome hearts online curry 4 lebron shoes asics running shoes goyard handbags nike foamposite coach outlet sale air max 2018 hermes belt kyrie 4 shoes jordan retro 6 adidas superstars goyard bags cheap nba jerseys hermes outlet online michael kors outlet air jordans russell westbrook shoes yeezy boost 350 v2 hermes bags jordan 12 lacoste polo shirts longchamp handbags fitflops sale clearance yeezys longchamp kd 10 birkin bag ralph lauren uk jordan 4 golden goose sneakers ysl handbags lacoste polo converse outlet store nike air max nmd valentino ysl longchamp bags converse outlet harden shoes adidas stan smith shoes adidas eqt support yeezy boost fila hogan outlet nike basketball shoes nike air max goyard canada goose jacket coach factory outlet yeezy boost paul george shoes nike epic react retro jordans iniki bape hoodie moncler jacket nike air max jordan shoes cheap mlb jerseys adidas yeezy adidas outlet online canada goose fila yeezy boost 350 air jordan curry 5 balenciaga shoes nike air max 270 stephen curry 5 golden goose nike roshe calvin klein outlet online michael kors outlet michael kors outlet online rolex replica bape hoodie ferragamo belt yeezy boost 350 michael jordan shoes michael kors handbags off white hoodie nike shox for men jordans red bottom heels coach outlet kobe 9 goyard bags ralph lauren uk nmd michael kors outlet hermes online shop jordan retro pure boost golden goose outlet adidas outlet balenciaga shoes fake rolex watches balenciaga sneakers nike air force 1 coach outlet chrome hearts online jordan shoes adidas iniki coach outlet yeezy boost gucci belts golden goose sneakers kd 11 stephen curry 5 nike huarache air jordan 13 birkin bag coach outlet sale goyard wallet michael kors handbags lebron shoes ferragamo belt vans shoes michael kors outlet jordan 13 adidas yeezy boost fila shoes ferragamo belts tory burch outlet nike sneakers kobe 9 lebron 10 yeezy boost 350 v2 lebron 16 adidas shoes online yeezy shoes yeezy boost 500 michael kors jordan 11 cheap jordans links of london outlet store nike max lebron 15 shoes supreme hoodie hermes handbags off white clothing goyard st louis tot reebok outlet air max 90 chrome hearts moncler jackets nike jordans jordan sneakers off white x jordan 1 golden goose sneakers yeezy boost golden goose michael kors factory outlet adidas stan smith nba jerseys coach outlet online adidas superstar golden goose tory burch off white shoes adidas yeezy tory burch sandals yeezy boost 350 yeezy 700 jordans lacoste adidas nmd kyrie 4 golden goose adidas nmd cheap jordans air force 1 yeezy boost kobe basketball shoes birkin bag golden goose outlet michael kors uk reebok shoes jordan 11 retro baseball jerseys 100% real jordans for cheap adidas nmd runner supreme clothing nike air force lebron 16 ferragamo belts louboutin shoes uk moncler outlet jordan retro 12 Kanye West shoes lebron 15 air max christian louboutin off white lacoste polo yeezy shoes michael kors handbags outlet zx flux yeezy boost 350 v2 pandora jewelry kobe 11 adidas eqt kyrie shoes adidas ultra kobe 11 off white clothing yeezy 500 mbt shoes outlet chrome hearts online kobe shoes off white jordan 1 michael kors outlet mlb jerseys