On Error Resume Next Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20 arrComputers = Array("ComputerName")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="    Set objWMIService = GetObject("winmgmts:" & strComputer & "rootWMI")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_DeviceWakeOnMagicPacketOnly", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)    For Each objItem In colItems
      WScript.Echo "Active: " & objItem.Active
      WScript.Echo "EnableWakeOnMagicPacketOnly: " & objItem.EnableWakeOnMagicPacketOnly
      WScript.Echo "InstanceName: " & objItem.InstanceName
      ''WScript.Echo   " **Computer" & strComputer & "  WOL Settings Failed to Retrive"
     
   Next
Next
 

Leave a Reply

Your email address will not be published. Required fields are marked *