Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to shut down all PCs on a network at a specific time, with a few exceptions.

Posted on 2008-06-17
6
Medium Priority
?
287 Views
Last Modified: 2012-05-05
I have a need to power down all PCs on the network (across two physical sites) that are still on after 10pm nightly.
There are about 40 PCs (out of 500+) that need to be kept on to run overnight processes or for remote connection for troubleshooting issues.

We have Windows Server 2000 and Windows Server 2003 for most of our servers. We also have Altiris for remote software deployment and remote control purposes.

How would I use either of these systems (Windows Server or Altiris) to power down the PCs, with some exclusions??
0
Comment
Question by:Rartemass
[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
6 Comments
 
LVL 3

Accepted Solution

by:
amritgill earned 600 total points
ID: 21810244
If you have configuration manger you can issue a shutdown command.

Also no policy, but this might do it:
http://www.specopssoft.com/products/specopsgpupdate/

It is a tool that lets you perform actions per OU - such as mass group policy update, mass shutdown, etc.
0
 
LVL 18

Author Comment

by:Rartemass
ID: 21810264
Thanks.
I'll check if we have config manager. I wasn' t involved with setting up the servers so unsure on what is installed.
I will investigate the specops software too. Quick question, does this software know when a PC is already powered down and skip it; or does it power it on to turn if back off?
0
 
LVL 23

Assisted Solution

by:debuggerau
debuggerau earned 400 total points
ID: 21810357
this is the script I use:

Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Set objFSO = CreateObject("Scripting.FileSystemObject")
strComputer = "."
 
On Error Resume Next
 
Set objOU = GetObject("LDAP://CN=Computers,dc=<yourdomainname>,dc=local")
objOU.Filter = Array("Computer")
Dim iNum
For Each objComputer in objOU
    iNum = 0
    If objComputer.CN = "<Excluded machine name here>" Then iNum = 1
    If iNum = 0 then
	    strComputer = objComputer.CN
	    Set objShell = CreateObject("WScript.Shell")
	    strCommand = "%comspec% /c ping -n 3 -w 1000 " & strComputer & ""
	    Set objExecObject = objShell.Exec(strCommand)
	    Do While Not objExecObject.StdOut.AtEndOfStream
        	strText = objExecObject.StdOut.ReadAll()
	        If Instr(strText, "Reply") > 0 Then
 
		    Set objTextFile = objFSO.CreateTextFile(strComputer & ".tsv", True)
		    objTextFile.WriteLine "Machine Name" & vbtab & strComputer
 
	            'Set objComputer = GetObject("WinNT://" & strComputer & "")
	            'objComputer.Filter = Array("User")
	            'For Each objUser in objComputer
	            '    Wscript.Echo strComputer & "  " & objUser.Name
	            'Next
		    'Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
		    'strComputer & "\root\default:StdRegProv")
			    'strKeyPath = "SOFTWARE\Classes\exefile\shell\open\command\"
		    'strValueName = ""
		    'oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
	
		    'objTextFile.WriteLine "exefile: " & strValue & vbtab
           
		    strCommand = "%comspec% /c shutdown -s -m \\" & strComputer & " -t 1 -f "
		    Set objExecObject = objShell.Exec(strCommand)
	        Else
	            'Wscript.Echo strComputer & " could not be reached."
	        End If
	   Loop
    End if
Next

Open in new window

0
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 18

Author Comment

by:Rartemass
ID: 21810387
Thanks debuggerau.
I'll check that script out too.

Will get back to you both.
0
 
LVL 70

Expert Comment

by:KCTS
ID: 21810687
A simple batch script will also to the job eg

shutdown /s /t:10 /m Computer001
shutdown /s /t:10 /m Computer002
shutdown /s /t:10 /m Computer003
....
shutdown /s /t:10 /m Computer999
etc

Create the above as a text file, save it with the .bat extention and use task scheduler to tun it at the desired time
0
 
LVL 18

Author Closing Comment

by:Rartemass
ID: 31468230
Thanks for your help.
The two methods awarded points have been tested and appear to work fine.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

664 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