1 Reply Latest reply on Jan 9, 2012 6:45 PM by jasonbigham

    Changing the Wol settings on a Nic

    rainmakers99

      I'm working on a script to change the Wake on lan settings for a nic.     I've loaded the intel proset software  and able to read the values for wol.  In the vbs script below.    I'm having problems calling the SetWakeOnLanPowerOptions.   Could someone take a quick look and let me know howto fix.

       

      Joe--

       

      'ON error resume next

      strComputer = "."
      Set objWMIService = GetObject("winmgmts:" _
          & "\\" & strComputer & "\root\IntelNCS2")
      Set colItems = objWMIService.ExecQuery _
          ("Select * from IANet_PhysicalEthernetAdapter")
      For Each objItem in colItems

      '**  This call in the program gets the wol properties **   
        output = objItem.GetWakeOnLanPowerOptions( WakeOnMagicePacketFromPowerOff, WakeOnLink , WakeOnMagicPacket, WakeOnDirectedPacket)

        Wscript.echo "Wake Machine from Poweroff State" & WakeOnMagicePacketFromPowerOff
        Wscript.echo "Wake the machine when Link is Present " & WakeOnLink
        Wscript.echo "Wake the machine on Magic Packet " & WakeOnMagicPacket
        Wscript.echo "Wake the machine on Directected Packet " & WakeOnDirectedPacket

      '** This call is trying to set all options on **
        output = objItem.SetWakeOnLanPowerOptions( 1 , 1 , 1 , 1, 1)


      Next