Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Shutting down a room of computers

Posted on 2008-10-27
7
Medium Priority
?
219 Views
Last Modified: 2010-04-23
I'm trying to remotely shutdown a room of computers, for this example i'll call the room BB. All the computers are named BB-01 to BB-20. I've tried a few scripts i've found but they just dont seem to do anything.

The last one i tried was:
[code] Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim NumComp As String = "01"
        Shell("shutdown.exe -r -m \\BB-" & NumComp & " -t 60 -c ""This workstation will restart in 60 seconds, please save any work.""")
    End Sub

End Class [/code]

Is there something special i need to do? Do i need to authenticate?

Thanks.
0
Comment
Question by:alumwell
  • 5
7 Comments
 
LVL 16

Expert Comment

by:JoWickerman
ID: 22811888
Hi alumwell,

I'm not a developer, but I know that only a domain administrator may send a shutdown command to a PC connected to a domain.

Cheers.
0
 
LVL 3

Expert Comment

by:Darksied9
ID: 22811899
If these are all Active Directory Members, which I hope, then set the script authenticate as a user that has permissions to kill a PC, which a standard "Everyone" member does not.  Even if you run the script as an administrator, you are calling another shell command that probably won't pass that authentication on...not 100% on that though.  If I were going to do this I would simply put the following command as many times as needed (I am assuming by hard coding the BB your PCs are pretty much going to remain the same) in a CMD and execute the CMD as an admin.

Not as pretty as VB, but...
shutdown.exe -r -m \\BB-01 -t 60 -c "This workstation will restart in 60 seconds, please save any work."
shutdown.exe -r -m \\BB-02 -t 60 -c "This workstation will restart in 60 seconds, please save any work."
shutdown.exe -r -m \\BB-03 -t 60 -c "This workstation will restart in 60 seconds, please save any work."

Open in new window

0
 
LVL 3

Accepted Solution

by:
Darksied9 earned 2000 total points
ID: 22811993
Actually, if you really want to do this quick and dirty, put all the file names in a shutdown.txt file and the put the attached script in the command shell...

May have to add:

-u user
-p Pass

for authentication, but I don't think so if the executing user has permissions.

This will execute psshutdown ( http://download.sysinternals.com/Files/PsTools.zip ) -- Microsoft owns it now :(  but it should work.
c:\psshutdown.exe @file.txt -t 60 -f -k -m "This PC Will Blow Up In 60 Seconds!  Run You Fool!"

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Expert Comment

by:Darksied9
ID: 22812000
Oops... That should be:
c:\psshutdown.exe @shutdown.txt -t 60 -f -k -m "This PC Will Blow Up In 60 Seconds!  Run You Fool!"

Open in new window

0
 
LVL 3

Expert Comment

by:Darksied9
ID: 22812037
On a small side note, it does not have to be a Domain Admin:

On workstations and servers: Administrators (Anyone in the Local Administrators - Enterprise Admins, Domain Admins are granted this by default).
On domain controllers: Administrators, Server Operators.
0
 

Author Closing Comment

by:alumwell
ID: 31510263
Thanks. It works. Just got to get it into a script now. Thanks again.
0
 
LVL 3

Expert Comment

by:Darksied9
ID: 22812896
No problem.  Glad to help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

886 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