{"id":318,"date":"2019-04-02T19:48:30","date_gmt":"2019-04-02T19:48:30","guid":{"rendered":"http:\/\/michaelschultz.net\/tech\/?p=318"},"modified":"2019-04-02T19:58:28","modified_gmt":"2019-04-02T19:58:28","slug":"configmgr-run-script-kickoff-compliance-baseline-check","status":"publish","type":"post","link":"https:\/\/michaelschultz.net\/tech\/configmgr-run-script-kickoff-compliance-baseline-check\/","title":{"rendered":"ConfigMgr Run Script &#8211; Kickoff Compliance Baseline Check"},"content":{"rendered":"\n<p>I came across a code snippet by Mick Pletcher () that you can add to the end of a compliance item script to kick off the evaluation of a baseline.  I took that and added a parameter to it so you can use it as a ConfigMgr Run Script. It look like a lot of code but 90% is just documentation.<\/p>\n\n\n\n<!--more-->\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;#<br> .SYNOPSIS<br> ConfigMgr run script to evaluate a compliance setting baseline compliance based off the specified name of the baseline<br> .SYNTAX<br> .DESCRIPTION<br> .PARAMETER Name<br> Name of the compliance baseline<br> .INPUTS<br> .OUTPUTS<br> .NOTES<br> FileName: kickoff-compliance-baseline-check.ps1<br> Author: Michael Schultz<br> Contact: mschultz@necro-monkey.com<br> Created: 20190402<br> Modified: <br> Version: 1<br> Original PowerShell code from Mick Pletcher (Mick's IT Blog) - https:\/\/mickitblog.blogspot.com\/2019\/03\/initiating-sccm-compliance-check-via.html<br> .EXAMPLE<br> kickoff-compliance-baseline-check.ps1 -Name 'Baseline'<br> ><br> -----Parameters-----<br> Param(<br> [Parameter(Mandatory=$True)]<br> [string]$Name<br> )<br> -----Initializations and Module Imports-----<br> -----Variables-----<br> -----Functions-----<br> -----Logging-----<br> -----Execution-----<br> ([wmiclass]\"root\\ccm\\dcm:SMS_DesiredConfiguration\").TriggerEvaluation(((Get-WmiObject -Namespace root\\ccm\\dcm -class SMS_DesiredConfiguration | Where-Object {$_.DisplayName -eq $Name}).Name), ((Get-WmiObject -Namespace root\\ccm\\dcm -class SMS_DesiredConfiguration | Where-Object {$_.DisplayName -eq $Name}).Version))  <\/pre>\n\n\n\n<p>Script found on my GitHub Repo at <a href=\"https:\/\/github.com\/NecroMonkey\/vault\/blob\/master\/ConfigMgr-Run-Scripts\/kickoff-compliance-baseline-check.ps1\">https:\/\/github.com\/NecroMonkey\/vault\/blob\/master\/ConfigMgr-Run-Scripts\/kickoff-compliance-baseline-check.ps1<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I came across a code snippet by Mick Pletcher () that you can add to the end of a compliance item script to kick off the evaluation of a baseline. I took that and added a parameter to it so you can use it as a ConfigMgr Run Script. It look like a lot of &hellip; <a href=\"https:\/\/michaelschultz.net\/tech\/configmgr-run-script-kickoff-compliance-baseline-check\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;ConfigMgr Run Script &#8211; Kickoff Compliance Baseline Check&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,4,14,16],"tags":[],"class_list":["post-318","post","type-post","status-publish","format-standard","hentry","category-dcm","category-configmgr","category-powershell","category-run-script"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p98a2r-58","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":5,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":326,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/318\/revisions\/326"}],"wp:attachment":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}