Setting WOL for Local Area Network

This script will only output the setting that needs to be set.


Dim objWMIService, colItems, LANID
Set objWMIService = GetObject(“winmgmts:\\.\root\cimv2”)
Set colItems = objWMIService.ExecQuery(“Select * from Win32_NetworkAdapter Where NetConnectionID =’Local Area Connection'”,,48)
For Each objItem in colItems
LANID = objItem.DeviceID
Next

Do While Len(LANID) < 4 LANID = "0" & LANID Loop Wscript.Echo "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\" & LANID & "\PnPCapabilities" Wscript.Echo "Hex 100 or dec 256" [/powershell]

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT      CM_TC1.dbo.v_R_System.Name0, CAST(CM_TC1.dbo.v_TaskExecutionStatus.ExecutionTime as date ),  Max(CM_TC1.dbo.v_TaskExecutionStatus.Step)

 FROM         CM_TC1.dbo.v_TaskExecutionStatus INNER JOIN
                      CM_TC1.dbo.v_R_System ON CM_TC1.dbo.v_TaskExecutionStatus.ResourceID = CM_TC1.dbo.v_R_System.ResourceID LEFT OUTER JOIN
                      CM_TC1.dbo.v_Advertisement ON CM_TC1.dbo.v_TaskExecutionStatus.AdvertisementID = CM_TC1.dbo.v_Advertisement.AdvertisementID
Group by CM_TC1.dbo.v_R_System.Name0,CAST(CM_TC1.dbo.v_TaskExecutionStatus.ExecutionTime as date )

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT     TOP (1000) CM_TC1.dbo.v_R_System.Name0, CM_TC1.dbo.v_Advertisement.AdvertisementName, CM_TC1.dbo.v_TaskExecutionStatus.Step, 
                      CM_TC1.dbo.v_TaskExecutionStatus.ActionName, CM_TC1.dbo.v_TaskExecutionStatus.LastStatusMessageIDName, CM_TC1.dbo.v_TaskExecutionStatus.ExitCode, 
                      CM_TC1.dbo.v_TaskExecutionStatus.ActionOutput, CM_TC1.dbo.v_TaskExecutionStatus.ExecutionTime, CM_TC1.dbo.v_TaskExecutionStatus.ResourceID
FROM         CM_TC1.dbo.v_TaskExecutionStatus INNER JOIN
                      CM_TC1.dbo.v_R_System ON CM_TC1.dbo.v_TaskExecutionStatus.ResourceID = CM_TC1.dbo.v_R_System.ResourceID LEFT OUTER JOIN
                      CM_TC1.dbo.v_Advertisement ON CM_TC1.dbo.v_TaskExecutionStatus.AdvertisementID = CM_TC1.dbo.v_Advertisement.AdvertisementID
ORDER BY CM_TC1.dbo.v_TaskExecutionStatus.ExecutionTime DESC