Seungweon's Blog

in Portland, Oregon

How to test WOL?

Whenever I test the WOL (Wake On Lan), it is very time consuming job to test all of the system's Sx state from remote controller (system).
In the meantime, there is Microsoft Tool to shutdown/hibernate using psshutdown.exe (2.52), and sleep command using psexec.exe with parameter "rundll32 powrprof.dll,SetSuspendState" or use "sleep.exe" in Microsoft Windows 2003 Resource Kits.
These two utilities can be found at http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx and you can use following test methods for Windows systems.

A. Setup the system under test (SUT) with Windows XP/Vista/Windows 7?

In order to use these utilities properly, need to setup the destination system like followings.

1. Right Click on "My Computer", choose "Manage" OR Click "Start", Run", type compmgmt.msc, click "Ok"
2. Expand "Shared Folders", Select "Shares", You should see the shares "ADMIN$","C$", and "IPC$".
3. If they are not there at then the "Server" service is probably not running. goto Control Panel->Admin Tools->Services. Find the "Server" service. Make sure it is Started. Also, Double-click the service and set the "Startup Type" to "Automatic".
4. Check the firewall on the system when you have "Access Denied"
5. Check Administrative rights required
6. HLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System has to have LocalAccountTokenFilterPolicy with REG_DWORD '1'.

B. Setup the controller to check the SUT working fine with WOL.

Running below script will give the result of each iteration of WOL tests from (S3/S4/S5).

hibernate.txt
-----------------

@echo off
REM.-- Prepare the Command Processor --
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

::: -- Version History ---
::: X.XX YYYYMMDD AUTHOR DESCRIPTION
::: 0.01 20090911 Seungweon Park This script is for shutdown/wake up from S3/S4/S5 using WOL magic packet.

SET "version=0.01" &:20090911 p.h. initial version, providing the framework
::: !! For a new version entry, copy the last entry down and modify Date, Author and Description

::: -- Set the window title ---
SET "title=%~nx0 - version %version%"

set count=1
cls
if "%1" == "" goto :Usage
:top
cls
echo.
echo ------------------
echo .... Try #%count%
echo ------------------
echo .... Shutdown the SUT. (don't use -k below)
psshutdown.exe \\%1 -u COLUMBUS -p password -h -t 0
if %errorlevel% gtr 0 goto ShutDownErr
echo .... Wait 25 Secs until the system is shutdowned.
echo.
call Wait.bat 25
echo.
echo .... Send a Magic packet.
wol 002421E8F63F
echo .... Wait 65 Secs until the system boots up.
echo.
call Wait.bat 65
echo.
echo .... Hibernate Test
ping -n 4 %1
if %errorlevel% gtr 0 goto ZapMe
set /a count=count+1
cls
goto Top

:ZapMe
color 47
echo.
echo ------------------
echo .... Try #%count%
echo ------------------
echo.
echo **********************************
echo Test Failed!!!
echo **********************************
pause
goto :EOF

:Usage
echo woltest.bat IP
echo IP : the ip address which is supposed to be assigned and check the device gets the ip address correctly within the specified time.
goto :EOF

:ShutDownErr
echo.
echo.
echo Can't shtudown the SUT, please check the SUT and IP
goto :EOF


P.S.: Change filename *.txt to *.bat, *.bin to *.exe (Download)

1 comments:

Seungweon Park said...

Those of you who may still be having "Access Denied" problems using psexec on XP, here's something else to look at: Apparently, updates to XP (most likely Security Updates delivered via Windows Update) now set a local security policy setting differently than in the past. Do Administrative Tools->Local Security Settings->Local Policies->Security Options and look for the line "Network Access:Sharing and security model for local accounts". As of at most 6 months ago, the default value for this "key" was "Classic - local users authenticate as themselves". But new XP installations and those with recent security updates will have a default value of "Guest only - local users authenticate as Guest". Change it back to "Classic - local users... etc.,." Now give psexec a shot.

source: http://forum.sysinternals.com/forum_posts.asp?TID=6196&PN=2

Post a Comment