{"id":17779,"date":"2019-06-07T02:32:43","date_gmt":"2019-06-07T10:32:43","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/powershell\/?p=17779"},"modified":"2019-06-07T02:54:16","modified_gmt":"2019-06-07T10:54:16","slug":"azure-policy-guest-configuration-service","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/azure-policy-guest-configuration-service\/","title":{"rendered":"Azure Policy Guest Configuration &#8211; Service"},"content":{"rendered":"<p><span data-contrast=\"auto\">This post builds upon the introduction published earlier\u00a0<\/span><a href=\"http:\/\/devblogs.microsoft.com\/powershell\/dsc-planning-update-june-2019\/\">to the PowerShell blog<\/a><span data-contrast=\"auto\">. In this post we are going to explore the Azure Policy Guest Configuration service.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The full documentation for this service is available at the following short\u00a0url.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/aka.ms\/gcpol\">https:\/\/aka.ms\/gcpol<\/a><\/p>\n<h3 aria-level=\"2\"><b><span data-contrast=\"none\">Resource provider<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">At a fundamental level, this solution includes a new resource provider in Azure named \u201cMicrosoft.GuestConfiguration\u201d and new virtual machine extensions named \u201cMicrosoft.GuestConfiguration.GuestConfigurationforLinux\u201d and \u201cMicrosoft.GuestConfiguration.GuestConfigurationforWindows\u201d.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The new engine is delivered\u00a0<\/span><span data-contrast=\"auto\">to the virtual machine\u00a0<\/span><span data-contrast=\"auto\">by the extension. When the service\/daemon starts, it queries\u00a0<\/span><span data-contrast=\"auto\">the\u00a0<\/span><span data-contrast=\"auto\">service<\/span><span data-contrast=\"auto\">\u00a0to see if there are any jobs for the virtual machine. If so, it downloads the content (DSC\u00a0<\/span><span data-contrast=\"auto\">mof<\/span><span data-contrast=\"auto\">\/modules, packaged in the same way as DSC extension), performs the work, and reports status<\/span><span data-contrast=\"auto\">. Behind the scenes, microservices and big data platforms ensure data remains geographically local.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The following diagram demonstrates the flow of requests as a Guest Assignment is published, the list of assignments\u00a0are\u00a0requested from the VM, the VM downloads and runs the configuration, status is returned to a regional location, and summary information is presented to Azure Policy.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">D<\/span><span data-contrast=\"auto\">iagram<\/span><span data-contrast=\"auto\">:<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/p>\n<p><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><img decoding=\"async\" class=\"alignnone wp-image-17782 size-large\" style=\"font-size: 1rem;\" src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/06\/Picture1-1024x501.png\" alt=\"\" width=\"640\" height=\"313\" srcset=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/06\/Picture1-1024x501.png 1024w, https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/06\/Picture1-300x147.png 300w, https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/06\/Picture1-768x376.png 768w, https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/06\/Picture1.png 1662w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><span data-contrast=\"auto\">You can think of the resource provider as surfacing VM scenarios in to Azure Resource Manager API. If you require that only one group of users should have administrative\u00a0<\/span><span data-contrast=\"auto\">privilege<\/span><span data-contrast=\"auto\">\u00a0inside a server, you can express that requirement as a Guest Assignment in Azure Resource Manager. This is just a reference to a configuration that checks (\u201cTest\u201d) whether only that group has the intended access and return who currently has access (\u201cGet\u201d). The scenario is given as a property of the virtual machine through a provider resource \u201cMicrosoft.GuestConfiguration\u201d.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Here is an example of that in code:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><code><i><span data-contrast=\"none\">{<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"apiVersion\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"2018-11-20\"<\/span><\/i><i><span data-contrast=\"none\">,<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"type\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"Microsoft.Compute\/virtualMachines\/providers\/guestConfigurationAssignments\"<\/span><\/i><i><span data-contrast=\"none\">,<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"name\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"[concat(parameters('vmName'), '\/Microsoft.GuestConfiguration\/', parameters('configurationName'))]\"<\/span><\/i><i><span data-contrast=\"none\">,<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"location\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"[parameters('location')]\"<\/span><\/i><i><span data-contrast=\"none\">,<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"properties\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">{<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"guestConfiguration\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">{<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"name\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"[parameters('configurationName')]\"<\/span><\/i><i><span data-contrast=\"none\">,<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"version\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"1.*\"<\/span><\/i><i><span data-contrast=\"none\">,<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"configurationParameter\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">[<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">{<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"name\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"[LocalGroup]AdministratorsGroup;Members\"<\/span><\/i><i><span data-contrast=\"none\">,<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"value\"<\/span><\/i><i><span data-contrast=\"none\">:<\/span><\/i><i><span data-contrast=\"auto\">\u00a0<\/span><\/i><i><span data-contrast=\"none\">\"[parameters('Members')]\"<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">}<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">]<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">}<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">}<\/span><\/i><\/code>\n<code><i><span data-contrast=\"auto\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/i><i><span data-contrast=\"none\">}<\/span><\/i><b><i><span data-contrast=\"none\">,<\/span><\/i><\/b><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/p>\n<h3 aria-level=\"3\"><b><span data-contrast=\"none\">Using built-in policies<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">One of our learnings from DSC has been to reduce complexity. We are aiming for a solution that you can just enable and immediately see value. A good example of this approach was Active Directory Group Policy. While Group Policy presented challenges for developers looking to rapidly iterate between builds, the concept of just picking the settings you need and turning them on has been popular with large enterprises.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Our current list of built-in content\u00a0<\/span><span data-contrast=\"auto\">is below.\u00a0 This is growing nearly every week.\u00a0 You can view this list in the Azure Portal by opening Policy and clicking Definitions, then changing the \u2018Type\u2019 filter to \u2018Initiative\u2019 and the \u2018Category\u2019 filter to \u2018Guest Configuration\u2019.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">\u00a0You can also run the following command to g<\/span><span data-contrast=\"auto\">et a current list using PowerShell with the Az cmdlet.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><code><span data-contrast=\"auto\">Get-AzPolicySetDefinition\u00a0-Builtin\u00a0| ?\u00a0{$_.Properties.Metadata.Category\u00a0-eq \"Guest Configuration\"} | % {$_.Properties.DisplayName}<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/code><\/p>\n<p><span data-contrast=\"auto\">NOTE: it is important when assigning these policies to use the Initiative.\u00a0 The\u00a0<\/span><span data-contrast=\"auto\">DeployIfNotExists<\/span><span data-contrast=\"auto\">\u00a0policy loads the VM extension, which is a requirement for Audit\/<\/span><span data-contrast=\"auto\">AuditIfNotExists<\/span><span data-contrast=\"auto\">\u00a0policies in Guest Configuration to work\u00a0<\/span><span data-contrast=\"auto\">properly<\/span><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<table style=\"height: 588px;\" border=\"1\" data-tablestyle=\"MsoTableGridLight\" data-tablelook=\"1984\">\n<tbody>\n<tr style=\"height: 28px;\">\n<td style=\"height: 28px; width: 746px;\" data-celllook=\"65536\"><strong>Policy initiative\u00a0display\u00a0name\u00a0<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs in which the Administrators group does not contain only the specified members<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">[Preview]: Audit Windows VMs on which the Log Analytics agent is not connected as expected<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs in which the Administrators group does not contain\u00a0<\/span><span data-contrast=\"auto\">all of<\/span><span data-contrast=\"auto\">\u00a0the specified members<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs that do not have the specified applications installed<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">[Preview]: Audit VMs with insecure password security settings<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs that are not set to the specified time zone<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs that are not joined to the specified domain<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows web servers that are not using secure communication protocols<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">[Preview]: Audit Windows VMs on which Windows Defender Exploit Guard is not enabled<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows Server VMs on which Windows Serial Console is not enabled<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs in which the Administrators group contains any of the specified members<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">[Preview]: Audit Windows VMs that contain certificates expiring within the specified number of days<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">[Preview]: Audit Windows VMs that have not restarted within the specified number of days<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">[Preview]: Audit Windows VMs on which the DSC configuration is not compliant<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Linux VMs that do not have the specified applications installed<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs with a pending reboot<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs that do not have the specified Windows PowerShell modules installed<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">[Preview]: Audit Windows VMs that do not contain the specified certificates in Trusted Root<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Windows VMs that have the specified applications installed<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr style=\"height: 28px;\">\n<td style=\"padding-left: 30px; height: 28px; width: 746px;\" data-celllook=\"0\"><span data-contrast=\"auto\">Audit Linux VMs that have the specified applications installed<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 aria-level=\"3\"><b><span data-contrast=\"none\">Viewing results<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">You can view the results of the policy in Azure Portal (as described\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/governance\/policy\/how-to\/determine-non-compliance#azure-portal\"><i><span data-contrast=\"none\">here<\/span><\/i><\/a><span data-contrast=\"auto\">)\u00a0<\/span><span data-contrast=\"auto\">and<\/span><span data-contrast=\"auto\">\u00a0you also can get results using the cmdlets provided by a new module named\u00a0<\/span><i><span data-contrast=\"auto\">Az.GuestConfiguration<\/span><\/i><span data-contrast=\"auto\">. A step by step\u00a0<\/span><span data-contrast=\"auto\">gudie<\/span><span data-contrast=\"auto\">\u00a0for using these cmdlets is available\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/governance\/policy\/how-to\/determine-non-compliance#azure-powershell\"><i><span data-contrast=\"none\">here<\/span><\/i><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The key scenario for the cmdlets is to use the\u00a0<\/span><b><span data-contrast=\"auto\">Get-AzVmGuestPolicyStatusHistory<\/span><\/b><span data-contrast=\"auto\">\u00a0cmdlet with the -ShowOnlyChange\u00a0parameter. This will tell you every time a VM was out of compliance over the reporting period and why.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The Az Guest Configuration cmdlets are documented\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/az.guestconfiguration\/get-azvmguestpolicystatushistory?view=azps-2.2.0\"><i><span data-contrast=\"none\">here<\/span><\/i><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">You can also directly query the Azure Policy Guest Configuration REST API to see the results of your audits. This includes the \u201cCompliance Reasons\u201d data the returns the raw information from the tool used to perform the audit. For Windows this data includes the name of the DSC resource used to run Test and Get, and the data returned. For Linux this includes the fully formatted output from InSpec. For both platforms, we intend to be open and extensible going forward.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The API for getting compliance details is documented\u00a0<\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/rest\/api\/guestconfiguration\/\"><i><span data-contrast=\"none\">here<\/span><\/i><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Thank you!<\/span>\n<span data-contrast=\"auto\">Michael Greene<\/span>\n<span data-contrast=\"auto\">Principal Program Manger<\/span>\n<span data-contrast=\"auto\">Microsoft Azure<\/span>\n<a href=\"https:\/\/twitter.com\/migreene\"><i><span data-contrast=\"none\">@migreene<\/span><\/i><\/a><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post builds upon the introduction published yesterday\u00a0to the PowerShell blog. In this post we are going to explore the Azure Policy Guest Configuration service.\u00a0<\/p>\n","protected":false},"author":658,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[142],"class_list":["post-17779","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-desired-state-configuration"],"acf":[],"blog_post_summary":"<p>This post builds upon the introduction published yesterday\u00a0to the PowerShell blog. In this post we are going to explore the Azure Policy Guest Configuration service.\u00a0<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/17779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/658"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=17779"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/17779\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=17779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=17779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=17779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}