PowerShell script that utilizes the wake on lan functionality in ConfigMgr 1810

With the release of ConfigMgr 1810 we were pleased to discover a new feature; the possibility to remotely wake any properly configured computer from sleep, this script demonstrates how to automate the functionality.

wol.ps1
 
 
 
 
 
5 Star
(1)
900 times
Add to favorites
System Center
1/22/2019
E-mail Twitter del.icio.us Digg Facebook
  • Weird Exception
    1 Posts | Last post December 13, 2019
    • Exception calling "InvokeMethod" with "3" argument(s): "Generic failure"
      At line:1 char:63
      +    ... return = $WMIConnection.psbase.InvokeMethod("MachinesToW ...
      +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : DotNetMethodException
      
      Same behaviour if I specify the collectionID, computername or both. If I don´t specify anything, it runs, but does nothing. 
      
      My Params look like this:
      __GENUS          : 2
      __CLASS          : __PARAMETERS
      __SUPERCLASS     :
      __DYNASTY        : __PARAMETERS
      __RELPATH        :
      __PROPERTY_COUNT : 2
      __DERIVATION     : {}
      __SERVER         :
      __NAMESPACE      :
      __PATH           :
      CollectionID     : ID of Collection
      MachineIDs       : ID of Computer to wake up 
      PSComputerName   :
      
      
      Any ideas?
      
      Thanks in advance!
  • Great Script
    1 Posts | Last post June 11, 2019
    • I also added the exclusion of collection ID SMSDM003 which "All Desktop and Server Clients" pretty much as dangerous as "All Systems"