Unzip the PowerStateUI.exe and PowerState.Engine.dll to the same folder and you are ready to start.  When you run PowerStateUI.exe it loads a list of computers from default.psx if it is in the same folder.  Logs files will be loaded to if logs.psx is in the same folder.


Build a List

Use the Browse button to build a list of computers from Active Directory or the network, or manually type in the names (or IP address) and MAC addresses of the computers.  Once you are done click the Update MAC Addresses button to automatically collect the MAC addresses from the computers via WMI.

The filter box has no effect on what systems will be operated on, it only helps you find systems in your list.

Start a Job

Computers that have the active box checked are included in a job.  The Job type is determine by clicking one of the Task buttons (Wake-On-LAN, reboot, update MAC address...).  This immediately starts a Job composed of one Task for each computer in the list marked as active.  Each task runs on its own thread with a maximum of 10 threads running concurrently.

Task Types

Shutdown - This task makes a WMI call to Win32_Shutdown in an attempt to reboot, logoff, poweroff or shutdown a computer.

ManagementBaseObject inparams = moTarget.GetMethodParameters("Win32Shutdown");
inparams["flags"] = flag;
ManagementBaseObject outparams = moTarget.InvokeMethod("Win32Shutdown", inparams, null);
result =  outparams["ReturnValue"].ToString();

Wake-On-LAN - This tasks sends a WOL UDP datagram to a computer on the port specified.

Update MAC Addresses - This task will attempt to update the MAC addresses in the current list by making a WMI call to the computer.  Any MAC address that matches this WMI query might be returned.

ManagementObjectSearcher query = new ManagementObjectSearcher(scope, "SELECT * FROM Win32_NetworkAdapter where NetConnectionId like '%local%'");




Last edited Oct 3, 2012 at 9:30 AM by Hill5Air, version 8


No comments yet.