Bylaw

Gallery › Guest Configuration › Azure built-in policies

[Deprecated]: Audit Windows VMs on which the specified services are not installed and 'Running'

Converted Initiative Version 1.0.0-deprecated Deprecated

This initiative deploys the policy requirements and audits Windows virtual machines on which the specified services are not installed and 'Running'. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol

ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.

Azure Policy JSONWindowsServiceStatus.json · 44 lines
{
  "properties": {
    "displayName": "[Deprecated]: Audit Windows VMs on which the specified services are not installed and 'Running'",
    "policyType": "BuiltIn",
    "description": "This initiative deploys the policy requirements and audits Windows virtual machines on which the specified services are not installed and 'Running'. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol",
    "metadata": {
      "version": "1.0.0-deprecated",
      "category": "Guest Configuration",
      "deprecated": true
    },
    "version": "1.0.0",
    "parameters": {
      "ServiceName": {
        "type": "string",
        "metadata": {
          "displayName": "Service names (supports wildcards)",
          "description": "A semicolon-separated list of the names of the services that should be installed and 'Running'. e.g. 'WinRm;Wi*'"
        }
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/32b1e4d4-6cd5-47b4-a935-169da8a5c262",
        "definitionVersion": "1.*.*",
        "policyDefinitionReferenceId": "Deploy_WindowsServiceStatus",
        "parameters": {
          "ServiceName": {
            "value": "[parameters('ServiceName')]"
          }
        }
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/c2dd2a9a-8a20-4a9c-b8d6-f17ccc26939a",
        "definitionVersion": "1.*.*",
        "policyDefinitionReferenceId": "Audit_WindowsServiceStatus"
      }
    ],
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/8eeec860-e2fa-4f89-a669-84942c57225f",
  "name": "8eeec860-e2fa-4f89-a669-84942c57225f"
}
Bylaw8eeec860-e2fa-4f89-a669-84942c57225f.bylaw.ps1 · 30 lines
# Converted from WindowsServiceStatus.json by ConvertTo-Bylaw.
Initiative '8eeec860-e2fa-4f89-a669-84942c57225f' {

    Properties @{
        DisplayName   = '[Deprecated]: Audit Windows VMs on which the specified services are not installed and ''Running'''
        Description   = 'This initiative deploys the policy requirements and audits Windows virtual machines on which the specified services are not installed and ''Running''. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol'
        Version       = '1.0.0-deprecated'
        Category      = 'Guest Configuration'
        Deprecated    = $true
        PolicyVersion = '1.0.0'
    }

    Parameter ServiceName @{
        Type        = 'string'
        DisplayName = 'Service names (supports wildcards)'
        Description = 'A semicolon-separated list of the names of the services that should be installed and ''Running''. e.g. ''WinRm;Wi*'''
        JsonName    = 'ServiceName'
    }

    PolicyDefinition @{
        Id          = '32b1e4d4-6cd5-47b4-a935-169da8a5c262'
        ReferenceId = 'Deploy_WindowsServiceStatus'
        Version     = '1.*.*'
        Parameters  = @{
            ServiceName = (Param ServiceName)
        }
    }

    PolicyDefinition -Id 'c2dd2a9a-8a20-4a9c-b8d6-f17ccc26939a' -ReferenceId 'Audit_WindowsServiceStatus' -Version '1.*.*'
}

Members (2)

Source: built-in-policies/policySetDefinitions/Guest Configuration/WindowsServiceStatus.json in Azure/azure-policy, under the MIT licence.