Powershell function that lets you invoke / trigger ConfigMgr baseline evaluation on a singel remote computer

 

If you want to invoke this function on a device collection, go here: https://gallery.technet.microsoft.com/Invoke-baseline-evaluation-f6e8fd3d?redir=0

 

Original blog post and instructions how to use the function here: https://timmyit.com/2016/07/26/sccm-and-powershell-trigger-baseline-evaluation-on-client/

Uservoice to get this implemented as feature in ConfigMgr: https://configurationmanager.uservoice.com/forums/300492-ideas/suggestions/18652852-console-ui-function-to-invoke-evaluation-of-baseli

 

PowerShell
Edit|Remove
function Invoke-BLEvaluation 
{ 
 param ( 
 [String][Parameter(Mandatory=$true, Position=1)] $ComputerName, 
 [String][Parameter(Mandatory=$False, Position=2)] $BLName 
 ) 
 If ($BLName -eq $Null) 
{ 
 $Baselines = Get-WmiObject -ComputerName $ComputerName -Namespace root\ccm\dcm -Class SMS_DesiredConfiguration 
} 
 Else 
{ 
 $Baselines = Get-WmiObject -ComputerName $ComputerName -Namespace root\ccm\dcm -Class SMS_DesiredConfiguration | Where-Object {$_.DisplayName -like $BLName} 
} 
  
$Baselines | % { 
  
 ([wmiclass]"\\$ComputerName\root\ccm\dcm:SMS_DesiredConfiguration").TriggerEvaluation($_.Name, $_.Version)  
  
} 
  
}