• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 472
  • Last Modified:

script to shutdown and startup computer at my school

Hi,

I work at an school and we had before a script that it works but after re-imaging the machines and a few changes in our network our script .bat file stop to work. Please find the code attached.

My question is: until we find out what had happened woud you know a local script i could put in each machine or a script i could run from my machine?

I hope to hear from you soon.

Happy new year.

Cheers,

Eduardo.
rem to Shutdown our workstations
\\blackhole\IT\Shutlab\down	\\wclab00	/P /Q
\\blackhole\IT\Shutlab\down	\\wclab01	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab02	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab03	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab04	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab05	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab06	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab07	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab08	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab09	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab10	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab11	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab12	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab13	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab14	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab15	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab16	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab17	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab18	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab19	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab20	/P /Q			
\\blackhole\IT\Shutlab\down	\\wclab21	/P /Q

rem to Start up our workstations

\\blackhole\IT\Shutlab\winwake 00:16:E6:05:D2:1E
\\blackhole\IT\Shutlab\winwake 00:16:E6:04:69:B8
\\blackhole\IT\Shutlab\winwake 00:16:E6:04:69:C8
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:D2:50
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:D2:38
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:F0:BC
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:D0:E2
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:EE:84
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:AC:E6
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:F0:F4
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:56:F2
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:5C:62
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:B1:38
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:E8:8A
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:F0:FC
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:EF:46
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:B1:02
\\blackhole\IT\Shutlab\winwake 00:16:E6:70:0C:B2
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:F1:B4
\\blackhole\IT\Shutlab\winwake 00:16:E6:05:B0:9C
\\blackhole\IT\Shutlab\winwake 00:16:E6:04:69:8E
\\blackhole\IT\Shutlab\winwake 00:16:41:EC:6E:F1

Open in new window

0
emilhomem
Asked:
emilhomem
  • 4
  • 2
  • 2
1 Solution
 
FayazCommented:
get a new batch file:
shutdown -r -m \\computer.name -t 00
above will restart the machine immediately
0
 
emilhomemAuthor Commented:
what about the start up. Sorry I could understand why only shutdown line but there is nothing related to start up. Can you clarify please!?
0
 
FayazCommented:
parameter <-r> will restart the machine.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
malcouCommented:
I can see you are trying to start the PCs via a wake-on-lan command
Is Wake-on-lan activated on the PC's ? - check in the system Bios
Winwake will send a UDP packet (default port 7) - Check this is not blocked by any firewalls.
You say you have done some network changes , can you ping the PC's from the machine running the script?

To shutdown you use "Down" command - don't know this but the "Shutdown" command works well but you will need RPC port open (135).
 - try shutdown -f -m \\computername

Let me know how it goes
0
 
emilhomemAuthor Commented:
Wake-on-lan is activated on the PC, yes. I have check the BIOS but I do not have the option to see any (default port 7). Can you tell me how I check if it is blocked by any firewall?

I have also ping the machines and it is ping as usual, no problem with that.

the shutdown -r - m \\machine.name -t 00 is working fine. With this command i can restart the machines but not wake them up.

I also can run the script to shut them all down.

The only problem still on how to wake them up.

Would you send me some instruction on how could I check if they are blocked by any firewall?

One more thing I forgot to tell you. This Lab has 22 machines, 21 are connected with two switches, ten machines in one and 11 machines linked to another switch. Only one machine the number 22 is not connected to the switch but to a spare drop on the wall and this one WAKES UP. Do you thing it could be that those Switches port are blocked by our Network Engineer? I have asked him but I don
't know if he can check or see that issue on his end.

Can you let me know what is your opinion on that?

Cheers,

Eduardo.
0
 
malcouCommented:
Sounds like your problem is the switches
You try to confirm this by connecting a different PC to the spare drop

What is the make and type of the switches?
Do you have a configuration for them?
Since winwake uses MAC addresses it will broadcast to all machines, is there anything in the switch configuration to stop the broadcast?

0
 
emilhomemAuthor Commented:
I have a colleague on the other branch that have the same problem as i have. We will talk to our Network Engineer again for him to check more thoroughly and try to find out what is the problem.

Many thanks for your help.
0
 
emilhomemAuthor Commented:
Many thanks for your help.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now