{"id":17780,"date":"2019-06-07T02:32:12","date_gmt":"2019-06-07T10:32:12","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/powershell\/?p=17780"},"modified":"2020-09-09T12:07:20","modified_gmt":"2020-09-09T20:07:20","slug":"azure-policy-guest-configuration-client","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/azure-policy-guest-configuration-client\/","title":{"rendered":"Azure Policy Guest Configuration &#8211; Client"},"content":{"rendered":"<p><span data-contrast=\"auto\">This post builds upon the introduction published\u00a0<\/span><span data-contrast=\"auto\">earlier\u00a0<\/span><a href=\"http:\/\/devblogs.microsoft.com\/powershell\/dsc-planning-update-june-2019\/\"><span data-contrast=\"none\">to the PowerShell blog<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">In this post we are going to explore the Azure Policy Guest Configuration client<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">and how configuration content is consumed.<\/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\"><span data-contrast=\"none\">https:\/\/aka.ms\/gcpol<\/span><\/a><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p>[Updated 9\/9\/2020 with changed file\/folder names]<\/p>\n<h3 aria-level=\"2\"><b><span data-contrast=\"none\">GC service\/daemon<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Inside Azure Policy Guest Configuration,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">you will find the new DSC engine as part of the extension<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">for virtual machines.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">You can see this using the<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">\u201c<\/span><span data-contrast=\"auto\">Run Command<\/span><span data-contrast=\"auto\">\u201d<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">feature in Azure<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">for any virtual machine that is being audited by Azure Policy<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">using one of the Guest Configuration initiatives.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The structure of the agent folders is the same for both operating systems.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">You will find a folder <\/span><span data-contrast=\"auto\">that contains the binaries for the engine,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">a folder named<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">\u201c<\/span><span data-contrast=\"auto\">logs<\/span><span data-contrast=\"auto\">\u201d<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">containing logs generated by the engine,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">and a subfolder named<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">\u201c<\/span><span data-contrast=\"auto\">downloads<\/span><span data-contrast=\"auto\">\u201d<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">that is used to support additional requirements.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Here are some example commands you can use to\u00a0take a look<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">at the new DSC engine yourself.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<h4 aria-level=\"3\"><b><span data-contrast=\"none\">Windows<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">The Guest Configuration extension for Windows has not been published to GitHub yet.<\/span><\/p>\n<p aria-level=\"4\"><b><span data-contrast=\"none\">List the binaries in Guest Configuration in Windows<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Command (note the version is current at this time but could change):<\/span><\/p>\n<pre><span style=\"font-size: 1rem;\">dir 'C:\\Packages\\Plugins\\Microsoft.GuestConfiguration.ConfigurationforWindows\\1.28.3.0\\dsc\\GC\\'<\/span><code><\/code><\/pre>\n<p><span data-contrast=\"auto\">Result:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<pre class=\"azc-text-stream-wrap-text\" role=\"log\" aria-live=\"polite\" aria-atomic=\"false\" aria-relevant=\"additions text\" aria-label=\"Output\"><span class=\"azc-log-stream-text azc-text-stream-wrap-word-text\">    Directory: C:\\Packages\\Plugins\\Microsoft.GuestConfiguration.ConfigurationforWindows\\1.28.3.0\\dsc\\GC\r\n\r\n\r\nMode                LastWriteTime         Length Name                                                                  \r\n----                -------------         ------ ----                                                                  \r\n-a----        7\/20\/2020   7:12 PM        1843712 gclib.dll                                                             \r\n-a----        7\/20\/2020   7:16 PM         204800 gc_cache_operations.dll                                               \r\n-a----        7\/20\/2020   7:03 PM         534528 gc_diagnostics.dll                                                    \r\n-a----        7\/20\/2020   7:01 PM         572416 gc_infrastructure.dll                                                 \r\n-a----        7\/20\/2020   7:05 PM          70144 gc_operations.dll                                                     \r\n-a----        7\/20\/2020   7:07 PM        2157056 gc_pull_client.dll                                                    \r\n-a----        7\/20\/2020   7:08 PM         463360 gc_reporting.dll                                                      \r\n-a----        7\/20\/2020   7:04 PM         459776 gc_security_tools.dll                                                 \r\n-a----        7\/20\/2020   7:18 PM         358400 gc_service.exe                                                        \r\n-a----        7\/20\/2020   7:14 PM         618496 gc_timer.dll                                                          \r\n-a----        7\/20\/2020   7:16 PM         213504 gc_timer_operations.dll                                               \r\n-a----        7\/20\/2020   7:17 PM         268288 gc_worker.exe                                                         \r\n-a----        7\/20\/2020   7:04 PM         398336 gc_worker_manager.dll  <\/span><\/pre>\n<p><span style=\"font-size: 1rem;\" data-contrast=\"auto\">You will also find an instance of pwsh.exe and supporting files in this same (version specific) folder. That is because Guest Configuration includes the portable installation of PowerShell Core so there is no need to manage PowerShell versions for the system.<\/span><span style=\"font-size: 1rem;\" data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p aria-level=\"4\"><b><span data-contrast=\"none\">View the details of the DSC service in Guest Configuration in Windows<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Command:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<pre><code><span data-contrast=\"none\">Get-Service<\/span><span data-contrast=\"auto\"> GCService | <\/span><span data-contrast=\"none\">fl<\/span><span data-contrast=\"auto\">\u00a0*<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/pre>\n<p><span data-contrast=\"auto\">Result:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><code><span data-contrast=\"auto\">Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : GCService<\/span><\/code>\n<code><span data-contrast=\"auto\">RequiredServices\u00a0\u00a0\u00a0 :\u00a0{}<\/span><\/code>\n<code><span data-contrast=\"auto\">CanPauseAndContinue\u00a0: False<\/span><\/code>\n<code><span data-contrast=\"auto\">CanShutdown\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :\u00a0False<\/span><\/code>\n<code><span data-contrast=\"auto\">CanStop\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :\u00a0True<\/span><\/code>\n<code><span data-contrast=\"auto\">DisplayName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :\u00a0Guest Configuration Service<\/span><\/code>\n<code><span data-contrast=\"auto\">DependentServices\u00a0\u00a0 :\u00a0{}<\/span><\/code>\n<code><span data-contrast=\"auto\">MachineName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :\u00a0.<\/span><\/code>\n<code><span data-contrast=\"auto\">ServiceName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : GCService<\/span><\/code>\n<code><span data-contrast=\"auto\">ServicesDependedOn\u00a0 : {}<\/span><\/code>\n<code><span data-contrast=\"auto\">ServiceHandle\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :\u00a0SafeServiceHandle<\/span><\/code>\n<code><span data-contrast=\"auto\">Status\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :\u00a0Running<\/span><\/code>\n<code><span data-contrast=\"auto\">ServiceType\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :\u00a0Win32OwnProcess<\/span><\/code>\n<code><span data-contrast=\"auto\">StartType\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :\u00a0Automatic<\/span><\/code>\n<code><span data-contrast=\"auto\">Site\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :<\/span><\/code>\n<code><span data-contrast=\"auto\">Container\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/p>\n<h4 aria-level=\"3\"><b><span data-contrast=\"none\">Linux<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">The Guest Configuration extension for Linux is published in GitHub<\/span><span data-contrast=\"auto\">\u00a0<\/span><a href=\"https:\/\/github.com\/Azure\/Guest-Configuration-Extension\"><span data-contrast=\"none\">here<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p aria-level=\"4\"><b><span data-contrast=\"none\">List the binaries in Guest Configuration in Linux<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Command (note the version is current at this time but could change):<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<pre><code><span data-contrast=\"auto\">sudo ls \/var\/lib\/waagent\/Microsoft.GuestConfiguration.ConfigurationforLinux-1.25.5\/GCAgent\/GC\/gc_*<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/pre>\n<p><span data-contrast=\"auto\">Result:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><code><span data-contrast=\"auto\">[stdout]\n<\/span><\/code>\/<span class=\"azc-log-stream-text azc-text-stream-wrap-word-text\">var\/lib\/waagent\/Microsoft.GuestConfiguration.ConfigurationforLinux-1.25.5\/GCAgent\/GC\/gc_linux_service \/var\/lib\/waagent\/Microsoft.GuestConfiguration.ConfigurationforLinux-1.25.5\/GCAgent\/GC\/gc_worker<\/span><\/p>\n<p><span data-contrast=\"auto\">Currently, Guest Configuration in Linux is only supporting content in the format of Chef InSpec profiles. We expect this to soon open to PowerShell-based resources and other tool formats.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p aria-level=\"4\"><b><span data-contrast=\"none\">View the details of the GC service in Guest Configuration in Linux<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Command:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<pre><code><span data-contrast=\"auto\">systemctl<\/span><span data-contrast=\"auto\"> status gcd.service<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/pre>\n<p><span data-contrast=\"auto\">Result:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<pre class=\"azc-text-stream-wrap-text\" role=\"log\" aria-live=\"polite\" aria-atomic=\"false\" aria-relevant=\"additions text\" aria-label=\"Output\"><span class=\"azc-log-stream-text azc-text-stream-wrap-word-text\">[stdout]\r\n\u25cf gcd.service - DSC Service\r\n   Loaded: loaded (\/lib\/systemd\/system\/gcd.service; enabled; vendor preset: enabled)\r\n   Active: active (running) since Wed 2020-09-09 16:43:12 UTC; 2h 38min ago\r\n Main PID: 4035 (gc_linux_servic)\r\n    Tasks: 42 (limit: 4075)\r\n   CGroup: \/system.slice\/gcd.service\r\n           \u2514\u25004035 \/var\/lib\/waagent\/Microsoft.GuestConfiguration.ConfigurationforLinux-1.25.5\/GCAgent\/GC\/gc_linux_service\r\n\r\nSep 09 16:43:12 ub0 systemd[1]: gcd.service: Service hold-off time over, scheduling restart.\r\nSep 09 16:43:12 ub0 systemd[1]: gcd.service: Scheduled restart job, restart counter is at 4.\r\nSep 09 16:43:12 ub0 systemd[1]: Stopped DSC Service.\r\nSep 09 16:43:12 ub0 systemd[1]: Started DSC Service.\r\nSep 09 16:43:12 ub0 gc_linux_service[4035]: Running DSC rest server...<\/span><\/pre>\n<h3 aria-level=\"2\"><b><span data-contrast=\"none\">Configurations<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Configurations in Guest Configuration are managed in a whole new way.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">There is no longer a need for partial configurations<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">because many configurations can be managed independently.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Please keep in mind that currently,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">configurations are used only for auditing settings<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">and not enforcing the configuration.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The model for Guest Configuration takes lessons learned<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">from both the DSC Extension and State Configuration service.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">The Guest Configuration service does not require or support<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">uploading and storing assets in the service,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">or a compilation service.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">Configurations are packaged in .zip format<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">as they were for DSC Extension.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">A Guest Assignment in the Guest Configuration<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">resource provider includes a reference to the location<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">of the package,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">a hash value of the package file,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">and a table of parameters to be passed to the engine when the configuration is executed.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">For content provided by Microsoft,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">the configuration content managed and replicated globally.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">When the package is downloaded to the machine,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">it is decompressed and extracted to a local folder.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Each folder contains everything needed for DSC<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">to manage\u00a0<\/span><span data-contrast=\"auto\">th<\/span><span data-contrast=\"auto\">e<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">configuration including<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">the\u00a0<\/span><span data-contrast=\"auto\">mof<\/span><span data-contrast=\"auto\">, any resources required, and the\u00a0<\/span><span data-contrast=\"auto\">metaconfiguration<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">to use for that configuration.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">This means the mode, frequency, and other LCM settings can be unique<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">per configuration.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p aria-level=\"3\"><b><span data-contrast=\"none\">View configuration content in Windows<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">In this test case, the server is in scope of multiple audit policies.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<pre><span data-contrast=\"auto\">Command:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span>\r\n\r\n<code><span data-contrast=\"auto\">dir c:\\programdata\\GuestConfig\\Configuration\\<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/pre>\n<p><span data-contrast=\"auto\">Result:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><code><span data-contrast=\"auto\">\u00a0Directory: C:\\programdata\\GuestConfig\\Configuration<\/span><\/code><\/p>\n<p><code><span data-contrast=\"auto\">Mode\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0LastWriteTime\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Length Name\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><\/code>\n<code><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\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/code>\n<code><span data-contrast=\"auto\">d-----\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6\/5\/2019\u00a0\u00a0 1:03 PM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0WindowsDefenderExploitGuard\u00a0\u00a0\u00a0<\/span><\/code>\n<code><span data-contrast=\"auto\">d-----\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6\/5\/2019\u00a0\u00a0 1:03 PM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0WindowsDscConfiguration\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/code>\n<code><span data-contrast=\"auto\">d-----\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6\/5\/2019\u00a0\u00a0 1:03 PM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0windowsfirewallenabled\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/code>\n<code><span data-contrast=\"auto\">d-----\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6\/5\/2019\u00a0\u00a0 1:03 PM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0WindowsLogAnalyticsAgentConnection\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><\/code>\n<code><span data-contrast=\"auto\">d-----\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6\/5\/2019\u00a0\u00a0 1:03 PM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0WindowsPendingReboot\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/code>\n<code><span data-contrast=\"auto\">d-----\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6\/5\/2019\u00a0\u00a0 1:04 PM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0WindowsPowerShellModules\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/code>\n<span data-contrast=\"auto\"><code>d-----\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6\/5\/2019\u00a0\u00a0 1:04 PM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0WindowsTimeZone\u00a0\u00a0<\/code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/p>\n<p aria-level=\"3\"><b><span data-contrast=\"none\">View configuration content in Linux<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">In this test case, the server is in scope of only one audit policy.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Command:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<pre><code><span data-contrast=\"none\">sudo ls<\/span><span data-contrast=\"auto\">\u00a0\/var\/lib\/GuestConfig\/Configuration<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/pre>\n<p><span data-contrast=\"auto\">Result:<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><code><span data-contrast=\"auto\">[<\/span><span data-contrast=\"auto\">stdout<\/span><span data-contrast=\"auto\">]<\/span><\/code>\n<code><span data-contrast=\"auto\">firewalldenabled<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/p>\n<h3 aria-level=\"2\"><b><span data-contrast=\"none\">Logs<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Log output is available on each node within the agent folder named<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">\u201c<\/span><span data-contrast=\"auto\">Logs<\/span><span data-contrast=\"auto\">\u201d<\/span><span data-contrast=\"auto\">.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">This can also be returned using<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">\u201c<\/span><span data-contrast=\"auto\">Run Command<\/span><span data-contrast=\"auto\">\u201d<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">however the output is limited to the last 4096\u00a0bytes\u00a0so it is best<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">to filter the logs to only what you are looking for.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">Examples approaches are given below.<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p aria-level=\"3\"><b><span data-contrast=\"none\">View error messages in Windows logs<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Command (note the version is current at this time but could change):<\/span><\/p>\n<pre><span style=\"font-size: 1rem;\">Select-String -Path 'C:\\programdata\\GuestConfig\\gc_agent_logs\\gc_agent.log' -pattern 'DSC*Engine' -CaseSensitive -Context 0,5<\/span><\/pre>\n<p><span data-contrast=\"auto\">Result (this is a short snippet of the actual output):<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><code><span data-contrast=\"auto\">[INFO] [00000000-0000-0000-0000-000000000000] Job\u00a0<\/span><\/code>\n<code><span data-contrast=\"auto\">3af0538a-35f4-415f-b5b8-70ae3099e6a2 :\u00a0Operation Get-DscConfiguration\u00a0<\/span><\/code>\n<code><span data-contrast=\"auto\">completed successfully.<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/p>\n<div>\n<div><code><\/code><\/div>\n<\/div>\n<p aria-level=\"3\"><b><span data-contrast=\"none\">View error messages in Linux logs<\/span><\/b><span data-ccp-props=\"{&quot;335559738&quot;:200,&quot;335559739&quot;:0}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Command (note the version is current at this time but could change):<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<pre>grep -A 5 'DSC*Engine' \/var\/lib\/GuestConfig\/gc_agent_logs\/gc_agent.log<\/pre>\n<p><span data-contrast=\"auto\">Result (this is a short snippet of the actual output):<\/span><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><code><span data-contrast=\"auto\">[<\/span><span data-contrast=\"auto\">2019-06-05<\/span><span data-contrast=\"auto\">\u00a018:14:22.772] [PID 30775] [TID 30824] [DSCEngine] [INFO] [00000000-0000-0000-0000-000000000000] Job 6ae51953-24aa-44e8-8abb-4ec522cc5b1f :\u00a0Method\u00a0CU_TestConfiguration\u00a0ended successfully<\/span><span data-ccp-props=\"{&quot;335559739&quot;:200}\">\u00a0<\/span><\/code><\/p>\n<p><code><\/code><\/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\"><span data-contrast=\"none\">@migreene<\/span><\/a><span data-ccp-props=\"{&quot;335559738&quot;:180,&quot;335559739&quot;:180}\">\u00a0<\/span><\/p>\n<p><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\u00a0earlier\u00a0to the PowerShell blog.\u00a0In this post we are going to explore the Azure Policy Guest Configuration client\u00a0and how configuration content is consumed.\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-17780","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\u00a0earlier\u00a0to the PowerShell blog.\u00a0In this post we are going to explore the Azure Policy Guest Configuration client\u00a0and how configuration content is consumed.\u00a0<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/17780","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=17780"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/17780\/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=17780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=17780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=17780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}