C:\Documents and Settings\Ne>shutdown -m \\192.168.x.xx -s -f -c "hello"
C:\Documents and Settings\Ne>c:\wolcmd 00222DC197xx 192.168.x.xx 255.255.255.0
7
Wake On Lan signal sent to Mac Address 00222DC197A5
via Broadcast Address 192.168.1.255 on port 7
***กรณี access deny
เพราะคุณไม่ได้ตั้งpolicyไว้ครับ
วิธีแก้ เข้าไปเครืองที่คุณจะสั่งปิด เปิดโปรแกรม Local Security Policy
(start->Run พิมพ์ secpol.msc)
แล้วไปที่ local policies->user rights assigment->force shutdown from a remote system
แล้ว add UserGroup ลงไป (ปกติจะเป็น Guest ไม่ก็ Administrator )
(credit : http://www.edugeek.net/forums/windows/33550-shutdown-restart-script-access-denied-5-a-2.html)
วิธีแก้ เข้าไปเครืองที่คุณจะสั่งปิด เปิดโปรแกรม Local Security Policy
(start->Run พิมพ์ secpol.msc)
แล้วไปที่ local policies->user rights assigment->force shutdown from a remote system
แล้ว add UserGroup ลงไป (ปกติจะเป็น Guest ไม่ก็ Administrator )
(credit : http://www.edugeek.net/forums/windows/33550-shutdown-restart-script-access-denied-5-a-2.html)
Wake On Lan Command Line
Looking for wolcmd for OS X - try here
Wake on Lan Command Line
The command line tool wolcmd is run from a dos prompt. The syntax is as follows:
wolcmd [mac address] [ip address] [subnet mask] [port number]
you can also do a local broadcast if you are running on an internal network thus
wolcmd [macaddress] 255.255.255.255 255.255.255.255
where mac address is the unique address of the network card. To find the mac address of a card you can either open the computer and read the address on the sticker on the card or much easier is, if you are using TCP/IP, ping the machine from a dos prompt (ping [machine name or ip number] i.e. ping delphi or ping 10.43.43.43) then issue an arp command (arp -a) which will list the ip number and physical address of the card.
If the port number is not specified it will default to port 7
Running from a batch file
Simply add multiple entries thus:
wolcmd 009027a324fe 195.188.159.20 255.255.255.0 8900
wolcmd 009024a731da 212.86.64.31 255.255.255.0 8900
wolcmd 009024a731da 212.86.64.31 255.255.255.0 8900
To run the batch file, say half an hour before everybody gets into work, use the AT command on a Windows NT computer.
The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command.
What does it look like
Wake on Lan Command Line ปลุกคอมให้ตื่นด้วย wol Wake on Lan Command Line **ข้อสำคัญเครื่องคุณมี WOL หรือเปล่าหากไม่มีทำไม่ได้เน้อซิบอกให้** 1. เรียก command prompt ขึ้นมาก่อนเน้อ 2. ใช้คำสั่ง wolcmd [mac address] [ip address] [subnet mask] [port number] ถ้าหากว่าอยู่ในวงแลนเดียวกันใช้รูปแบบนี้ก็ได้ครับ wolcmd [macaddress] 255.255.255.255 255.255.255.255 หากนึกไม่ออกว่าจะเอา mac address มาจากไหนลองใช้ ipconfig/all ดูละกันนะคร้าบ หรือไม่ก็ใช้ software ช่วย http://www.azib.net/ipscan/ อันนี้ก็พอช่วยได้ลองดูละกันนะครับ ถ้าหากว่า port number ไม่ได้กำหนดไว้ค่ามารตฐานจะใช้ port 7 สร้าง bat ไฟล์ขึ้นมาซะ ดังตัวอย่างนี้นะครับ wolcmd 001EC96F748C 192.168.1.111 255.255.255.255 7 หรือหากว่า กำหนดค่า port เอาไว้ก็จะเป็นประมาณเนี้ย wolcmd 001EC96F748C 192.168.1.111 255.255.255.0 8900 แถมคำสั่ง shutdown สร้างเป็น script เอาไว้สะดวกสบายดี หุหุหุ ยกเครดิต เจ๊ก บ้านโพครับ กรณีอยู่ในโดเมนเดียวกันเน้อ สร้าง bat ไฟล์ขึ้นมาอีกอัน shutdown.exe -s -f -m computername -t 02 -c "ใส่ message" pause เอ้าแถมให้อีกตื่นจากหลับไหลด้วย Internet Wake On Lan over the Internet http://www.depicus.com/wake-on-lan/woli.aspx |
his article will show you how to use the remote shutdown command tool in Windows to remotely shut down, restart, or logoff a local or networked computer. This can be very useful sometimes if you have multiple computers at home or on your network that you want to quickly shutdown or restart.
You can perform a remote shutdown from the command prompt using the shutdown command and it’s associated switches, from the remote shutdown dialog box, or from a batch file. I’ll try to go through all three in this guide.
Remote Shutdown Overview
Firstly, in order to remotely shutdown a computer on your network, you’ll need to make sure you have Administrative access to that computer. If you’re on a home network, the best way to do this is to make sure all computers are in the same workgroup and that they all have at least one Administrator account with the same user name and password.
You can also have different Administrator account names across computers, but then you’ll need to make sure you add the Administrator account of one computer to the account list on the other computers. You’ll also need to know all the names of the other computers on the network. You can do that by going toControl Panel and then clicking on System. Then click on the Computer Name tab.
Remote shutdown is useful for managing multiple computers at once and especially useful for helpdesk technicians when they have to fix remote computers.
Remote shutdown via Command Prompt
The shutdown command is most flexible when using it from the command prompt because you can add a bunch of switches to it, which allow you to customize the behavior. Go to Start, then Run, and type inCMD. In the black command window, type in shutdown /? to see the list of switches.
You have to use at least one switch in order for the command to do anything. Basically you would type inshutdown -X -Y -Z where X, Y, Z are letters in the list above.
Here are a couple of the most command switches and what actions they peform:
-l: Logs off the computer
-s: Shuts down the computer
-r: Restarts the computer
-m \\computername: remote shutdown of a computer
-f: Forces programs to close immediately
So for remotely shutting down another machine on your network, you would type into the command prompt the following commands:
shutdown –m \\computername –r –f
This above command will restart the computer named computername and force all programs that are still running to die.
shutdown –m \\computername –r –f –c “The computer will restart, please save all work.” –t 60
This command will restart the computer named computername, force all programs that are running to die, show a message to the user, and countdown 60 seconds before it restarts.
Remote Shutdown via Shutdown Dialog
If you don’t like all those switches, etc, or using the command prompt, then you can bring up the shutdown dialog box. You can open the dialog window by clicking Start, click Run, type CMD and typing shutdown -i and in the blank DOS window.
A window similar to the one below will appear:
Click the Add or Browse button to add computers to the list. You can then run the commands on the entire batch of computers. If you click Add, you’ll need to enter in the network name of the computer in the format \\computername. You can even add your own computer to test it out and make sure it works.
Of course, you need to know the actual computer name, which I mentioned how you can figure out above. You’ll also need Administrative access. You can determine this by going to My Computer and typing\\computername into the address bar and seeing if you can get access without having to be prompted for a password.
So add as many computers to the list as you like and then set your options. You can shutdown, restart, or logoff. You can also display a warning for however many seconds you like. You can type in a comment at the bottom which will be displayed to users. That’s it!
Remote Shutdown via Batch File
Finally, you can create a batch file so that you can do all of this by just clicking on a file! Or you can even schedule the batch file to be run at specific intervals using Windows Scheduler.
Just go to Notepad and type in the commands you would have typed into the command prompt:
This will restart three computers on my home network. You would of course replace computername1 with the actual names of your computers. Then simple save the file with a .BAT file extension. You can put as many commands into the batch file as you like, so feel free to experiment!
I’ve written an extensive post on how to use batch files in Windows, so read that if you are not familiar with batch files. Enjoy!
็ำ้help จาก mylanviwer
Wake on LAN (WOL) support is
implemented on the motherboard of a computer and the network interface, and as
such, is not dependent on the operating system running on the hardware, although
the operating system can sometimes control the WOL behavior. Most modern
motherboards with an embedded Ethernet controller support WOL without the need
for an external cable. Older motherboards must have a WAKEUP-LINK header on
board and connected to the network card via a special 3-pin cable. However,
systems supporting the PCI 2.2 standard coupled with a PCI 2.2 compliant network
adapter typically do not require a WOL cable as the required standby power is
relayed through the PCI bus.
First of all Wake on LAN must be enabled in the Power Management section of the motherboard's BIOS. WOL enabling item name can differ according to the BIOS manufacturer (Power On by LAN, Wake On LAN, Power on by PCI Devices or Power on by PCIE Devices, Power on by PME, etc.). To get the detailed information on how to enable WOL in the BIOS of your motherboard please refer to Motherboard User Manual or to the system manufacturer.
The second requirement is that Wake on LAN must be enabled in the Network Adapter settings of the underlying operating system. This can be done from the properties of the network adapter in the Device Manager. Follow the steps below to enable Wake on LAN for Microsoft Windows:
1. Open Device Manager.
2. In the window opened expand the Network adapters node.
3. Select the adapter you want to configure to receive WOL packages, click on right click it and select Properties item in the drop-down menu.
4. In the dialog opened switch to the Advanced tab.
5. Change "Shutdown Wake-On-Lan" or "Wake-on-LAN after shutdown" or "Wake From Shutdown" property to Enabled.
6. Change "Wake on Magic Packet" property to Enabled or for "Wake-Up Capabilities" property choose Magic Packet value.
7. Press OK button to proceed.
The target Machine must be in shut down state (that means that the AC adapter was not turned of after the last shut down).
If you want to wake the Machines up from sleep or hibernate you must set up some additional Network Adapter settings. Follow the steps below to reach the goal for Microsoft Windows:
1. Open Device Manager.
2. In the window opened expand the Network adapters node.
3. Select the adapter you want to configure to receive WOL packages, click on right click it and select Properties item in the drop-down menu.
4. In the dialog opened switch to the Power Management tab.
5. Check "Allow this device to wake the computer" option.
6. Check "Only allow a magic packet to wake the computer" option to make sure it does not wake up on every single network activity that occurs.
7. Press OK button to proceed.
If the remote Machine already meet the requirements described or is reconfigured to meet them it is ready to be turned on using Wake on LAN action of Remote Shutdown
First of all Wake on LAN must be enabled in the Power Management section of the motherboard's BIOS. WOL enabling item name can differ according to the BIOS manufacturer (Power On by LAN, Wake On LAN, Power on by PCI Devices or Power on by PCIE Devices, Power on by PME, etc.). To get the detailed information on how to enable WOL in the BIOS of your motherboard please refer to Motherboard User Manual or to the system manufacturer.
The second requirement is that Wake on LAN must be enabled in the Network Adapter settings of the underlying operating system. This can be done from the properties of the network adapter in the Device Manager. Follow the steps below to enable Wake on LAN for Microsoft Windows:
1. Open Device Manager.
2. In the window opened expand the Network adapters node.
3. Select the adapter you want to configure to receive WOL packages, click on right click it and select Properties item in the drop-down menu.
4. In the dialog opened switch to the Advanced tab.
5. Change "Shutdown Wake-On-Lan" or "Wake-on-LAN after shutdown" or "Wake From Shutdown" property to Enabled.
6. Change "Wake on Magic Packet" property to Enabled or for "Wake-Up Capabilities" property choose Magic Packet value.
7. Press OK button to proceed.
The target Machine must be in shut down state (that means that the AC adapter was not turned of after the last shut down).
If you want to wake the Machines up from sleep or hibernate you must set up some additional Network Adapter settings. Follow the steps below to reach the goal for Microsoft Windows:
1. Open Device Manager.
2. In the window opened expand the Network adapters node.
3. Select the adapter you want to configure to receive WOL packages, click on right click it and select Properties item in the drop-down menu.
4. In the dialog opened switch to the Power Management tab.
5. Check "Allow this device to wake the computer" option.
6. Check "Only allow a magic packet to wake the computer" option to make sure it does not wake up on every single network activity that occurs.
7. Press OK button to proceed.
If the remote Machine already meet the requirements described or is reconfigured to meet them it is ready to be turned on using Wake on LAN action of Remote Shutdown
ไม่มีความคิดเห็น:
แสดงความคิดเห็น