Bylaw

Gallery › Guest Configuration › Azure built-in policies

[Preview]: Configure Local Administrator Password Solution (LAPS)

Doesn't convert yet Policy DeployIfNotExists Disabled Mode Indexed Version 1.0.0-preview Preview

This policy configures Local Administrator Password Solution (LAPS). For more information, see https://aka.ms/LAPS4ARC.

ConvertTo-Bylaw can't convert this policy yet:

Azure Policy JSONLocalAdministratorPasswordSolution_DINE.json · 884 lines
{
  "properties": {
    "displayName": "[Preview]: Configure Local Administrator Password Solution (LAPS)",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "This policy configures Local Administrator Password Solution (LAPS). For more information, see https://aka.ms/LAPS4ARC.",
    "metadata": {
      "category": "Guest Configuration",
      "version": "1.0.0-preview",
      "preview": true,
      "requiredProviders": [
        "Microsoft.GuestConfiguration"
      ],
      "guestConfiguration": {
        "name": "SetLocalAdministratorPasswordSolution",
        "version": "1.*",
        "configurationParameter": {
          "BackupDirectory": "Enforce password backup;Value",
          "PasswordComplexity": "Enforce password complexity;Value",
          "PasswordLength": "Enforce minimum password length;Value",
          "PassphraseLength": "Enforce minimum passphrase length;Value",
          "PasswordAgeDays": "Enforce password age in days;Value",
          "PostAuthenticationActions": "Enforce post-authentication actions;Value",
          "PostAuthenticationResetDelay": "Enforce post-authentication reset delay;Value",
          "AdministratorAccountName": "Enforce administrator account name;Value",
          "ADPasswordEncryptionEnabled": "Enforce password encryption;Value",
          "ADPasswordEncryptionPrincipal": "Enforce authorized password decryptors;Value",
          "ADEncryptedPasswordHistorySize": "Enforce encrypted password history size;Value",
          "PasswordExpirationProtectionEnabled": "Enforce password expiration protection;Value",
          "AutomaticAccountManagementEnabled": "Enforce automatic account management;Value",
          "AutomaticAccountManagementTarget": "Enforce automatic account management target;Value",
          "AutomaticAccountManagementNameOrPrefix": "Enforce automatic account name or prefix;Value",
          "AutomaticAccountManagementRandomizeName": "Enforce automatic account name randomization;Value",
          "AutomaticAccountManagementEnableAccount": "Enforce automatic account enablement;Value"
        }
      }
    },
    "version": "1.0.0-preview",
    "parameters": {
      "IncludeArcMachines": {
        "type": "string",
        "metadata": {
          "displayName": "Include Arc connected machines",
          "description": "By selecting this option, you agree to be charged monthly per Arc connected machine.",
          "portalReview": "true"
        },
        "allowedValues": [
          "true",
          "false"
        ],
        "defaultValue": "false"
      },
      "effect": {
        "type": "string",
        "metadata": {
          "displayName": "Effect",
          "description": "Set the effect for this policy. DeployIfNotExists will remediate non-compliant machines. Disabled will disable the policy."
        },
        "allowedValues": [
          "DeployIfNotExists",
          "Disabled"
        ],
        "defaultValue": "DeployIfNotExists"
      },
      "BackupDirectory": {
        "type": "string",
        "metadata": {
          "displayName": "Password backup directory",
          "description": "Configure which directory the local admin account password is backed up to. 0 = Disabled, 1 = Azure Active Directory, 2 = Active Directory."
        },
        "allowedValues": [
          "0",
          "1",
          "2"
        ],
        "defaultValue": "1"
      },
      "PasswordComplexity": {
        "type": "string",
        "metadata": {
          "displayName": "Password complexity",
          "description": "Configure the complexity of the generated password. 1 = Large letters, 2 = Large letters and small letters, 3 = Large letters, small letters, and numbers, 4 = Large letters, small letters, numbers, and special characters."
        },
        "allowedValues": [
          "1",
          "2",
          "3",
          "4"
        ],
        "defaultValue": "4"
      },
      "PasswordLength": {
        "type": "string",
        "metadata": {
          "displayName": "Password length",
          "description": "Configure the length of the generated password. Minimum is 8, maximum is 64."
        },
        "defaultValue": "15"
      },
      "PassphraseLength": {
        "type": "string",
        "metadata": {
          "displayName": "Passphrase length",
          "description": "Configure the number of words in the generated passphrase. Minimum is 3, maximum is 10."
        },
        "defaultValue": "6"
      },
      "PasswordAgeDays": {
        "type": "string",
        "metadata": {
          "displayName": "Password age (days)",
          "description": "Configure the maximum password age in days. The password will be rotated after this number of days."
        },
        "defaultValue": "30"
      },
      "PostAuthenticationActions": {
        "type": "string",
        "metadata": {
          "displayName": "Post-authentication actions",
          "description": "Configure the actions to take after authenticating with the managed account. 0 = None, 1 = Reset password, 3 = Reset password and logoff, 5 = Reset password and reboot."
        },
        "allowedValues": [
          "0",
          "1",
          "3",
          "5"
        ],
        "defaultValue": "3"
      },
      "PostAuthenticationResetDelay": {
        "type": "string",
        "metadata": {
          "displayName": "Post-authentication reset delay (hours)",
          "description": "Configure the delay in hours before the post-authentication actions are executed."
        },
        "defaultValue": "24"
      },
      "AdministratorAccountName": {
        "type": "string",
        "metadata": {
          "displayName": "Administrator account name",
          "description": "Configure the name of the local administrator account to manage. Leave empty to manage the built-in administrator account."
        },
        "defaultValue": ""
      },
      "ADPasswordEncryptionEnabled": {
        "type": "string",
        "metadata": {
          "displayName": "Password encryption enabled",
          "description": "Configure whether the password is encrypted before being stored in Active Directory. 0 = Disabled, 1 = Enabled."
        },
        "allowedValues": [
          "0",
          "1"
        ],
        "defaultValue": "1"
      },
      "ADPasswordEncryptionPrincipal": {
        "type": "string",
        "metadata": {
          "displayName": "Authorized password decryptors",
          "description": "Configure the user or group that is authorized to decrypt the password from Active Directory."
        },
        "defaultValue": ""
      },
      "ADEncryptedPasswordHistorySize": {
        "type": "string",
        "metadata": {
          "displayName": "Encrypted password history size",
          "description": "Configure how many previous encrypted passwords are stored in Active Directory. 0 = Disabled."
        },
        "defaultValue": "0"
      },
      "PasswordExpirationProtectionEnabled": {
        "type": "string",
        "metadata": {
          "displayName": "Password expiration protection",
          "description": "Configure whether password expiration protection is enabled. 0 = Disabled, 1 = Enabled."
        },
        "allowedValues": [
          "0",
          "1"
        ],
        "defaultValue": "1"
      },
      "AutomaticAccountManagementEnabled": {
        "type": "string",
        "metadata": {
          "displayName": "Automatic account management",
          "description": "Configure whether automatic account management is enabled. 0 = Disabled, 1 = Enabled."
        },
        "allowedValues": [
          "0",
          "1"
        ],
        "defaultValue": "0"
      },
      "AutomaticAccountManagementTarget": {
        "type": "string",
        "metadata": {
          "displayName": "Automatic account management target",
          "description": "Configure the target for automatic account management. 0 = Built-in administrator account, 1 = New local admin account."
        },
        "allowedValues": [
          "0",
          "1"
        ],
        "defaultValue": "1"
      },
      "AutomaticAccountManagementNameOrPrefix": {
        "type": "string",
        "metadata": {
          "displayName": "Automatic account name or prefix",
          "description": "Configure the name or prefix for the automatically managed account."
        },
        "defaultValue": "WLapsAdmin"
      },
      "AutomaticAccountManagementRandomizeName": {
        "type": "string",
        "metadata": {
          "displayName": "Randomize automatic account name",
          "description": "Configure whether the name of the managed account uses a random numeric suffix. 0 = Disabled, 1 = Enabled."
        },
        "allowedValues": [
          "0",
          "1"
        ],
        "defaultValue": "0"
      },
      "AutomaticAccountManagementEnableAccount": {
        "type": "string",
        "metadata": {
          "displayName": "Enable automatic account",
          "description": "Configure whether to enable the automatically managed account. 0 = Disabled, 1 = Enabled."
        },
        "allowedValues": [
          "0",
          "1"
        ],
        "defaultValue": "0"
      }
    },
    "policyRule": {
      "if": {
        "anyOf": [
          {
            "allOf": [
              {
                "field": "type",
                "in": [
                  "Microsoft.Compute/virtualMachines",
                  "Microsoft.Compute/virtualMachineScaleSets"
                ]
              },
              {
                "field": "tags['aks-managed-orchestrator']",
                "exists": false
              },
              {
                "field": "tags['aks-managed-poolName']",
                "exists": false
              },
              {
                "anyOf": [
                  {
                    "field": "Microsoft.Compute/imagePublisher",
                    "in": [
                      "esri",
                      "incredibuild",
                      "MicrosoftDynamicsAX",
                      "MicrosoftSharepoint",
                      "MicrosoftVisualStudio",
                      "MicrosoftWindowsDesktop",
                      "MicrosoftWindowsServerHPCPack"
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "Microsoft.Compute/imagePublisher",
                        "equals": "MicrosoftWindowsServer"
                      },
                      {
                        "field": "Microsoft.Compute/imageSKU",
                        "notLike": "2008*"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "Microsoft.Compute/imagePublisher",
                        "equals": "MicrosoftSQLServer"
                      },
                      {
                        "field": "Microsoft.Compute/imageOffer",
                        "notLike": "SQL2008*"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "Microsoft.Compute/imagePublisher",
                        "equals": "microsoft-dsvm"
                      },
                      {
                        "field": "Microsoft.Compute/imageOffer",
                        "like": "dsvm-win*"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "Microsoft.Compute/imagePublisher",
                        "equals": "microsoft-ads"
                      },
                      {
                        "field": "Microsoft.Compute/imageOffer",
                        "in": [
                          "standard-data-science-vm",
                          "windows-data-science-vm"
                        ]
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "Microsoft.Compute/imagePublisher",
                        "equals": "batch"
                      },
                      {
                        "field": "Microsoft.Compute/imageOffer",
                        "equals": "rendering-windows2016"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "Microsoft.Compute/imagePublisher",
                        "equals": "center-for-internet-security-inc"
                      },
                      {
                        "field": "Microsoft.Compute/imageOffer",
                        "like": "cis-windows-server-201*"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "Microsoft.Compute/imagePublisher",
                        "equals": "pivotal"
                      },
                      {
                        "field": "Microsoft.Compute/imageOffer",
                        "like": "bosh-windows-server*"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "Microsoft.Compute/imagePublisher",
                        "equals": "cloud-infrastructure-services"
                      },
                      {
                        "field": "Microsoft.Compute/imageOffer",
                        "like": "ad*"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "anyOf": [
                          {
                            "field": "Microsoft.Compute/virtualMachines/osProfile.windowsConfiguration",
                            "exists": true
                          },
                          {
                            "field": "Microsoft.Compute/virtualMachines/storageProfile.osDisk.osType",
                            "like": "Windows*"
                          },
                          {
                            "field": "Microsoft.Compute/VirtualMachineScaleSets/osProfile.windowsConfiguration",
                            "exists": true
                          },
                          {
                            "field": "Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile.storageProfile.osDisk.osType",
                            "like": "Windows*"
                          }
                        ]
                      },
                      {
                        "anyOf": [
                          {
                            "field": "Microsoft.Compute/imageSKU",
                            "exists": false
                          },
                          {
                            "allOf": [
                              {
                                "field": "Microsoft.Compute/imageOffer",
                                "notLike": "SQL2008*"
                              },
                              {
                                "field": "Microsoft.Compute/imageSKU",
                                "notLike": "2008*"
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "allOf": [
              {
                "value": "[parameters('IncludeArcMachines')]",
                "equals": "true"
              },
              {
                "anyOf": [
                  {
                    "allOf": [
                      {
                        "field": "type",
                        "equals": "Microsoft.HybridCompute/machines"
                      },
                      {
                        "field": "Microsoft.HybridCompute/imageOffer",
                        "like": "windows*"
                      }
                    ]
                  },
                  {
                    "allOf": [
                      {
                        "field": "type",
                        "equals": "Microsoft.ConnectedVMwarevSphere/virtualMachines"
                      },
                      {
                        "field": "Microsoft.ConnectedVMwarevSphere/virtualMachines/osProfile.osType",
                        "like": "windows*"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "roleDefinitionIds": [
            "/providers/Microsoft.Authorization/roleDefinitions/088ab73d-1256-47ae-bea9-9de8e7131f31"
          ],
          "type": "Microsoft.GuestConfiguration/guestConfigurationAssignments",
          "name": "SetLocalAdministratorPasswordSolution",
          "existenceCondition": {
            "allOf": [
              {
                "field": "Microsoft.GuestConfiguration/guestConfigurationAssignments/complianceStatus",
                "equals": "Compliant"
              },
              {
                "field": "Microsoft.GuestConfiguration/guestConfigurationAssignments/parameterHash",
                "equals": "[base64(concat('Enforce password backup;Value', '=', parameters('BackupDirectory'), ',', 'Enforce password complexity;Value', '=', parameters('PasswordComplexity'), ',', 'Enforce minimum password length;Value', '=', parameters('PasswordLength'), ',', 'Enforce minimum passphrase length;Value', '=', parameters('PassphraseLength'), ',', 'Enforce password age in days;Value', '=', parameters('PasswordAgeDays'), ',', 'Enforce post-authentication actions;Value', '=', parameters('PostAuthenticationActions'), ',', 'Enforce post-authentication reset delay;Value', '=', parameters('PostAuthenticationResetDelay'), ',', 'Enforce administrator account name;Value', '=', parameters('AdministratorAccountName'), ',', 'Enforce password encryption;Value', '=', parameters('ADPasswordEncryptionEnabled'), ',', 'Enforce authorized password decryptors;Value', '=', parameters('ADPasswordEncryptionPrincipal'), ',', 'Enforce encrypted password history size;Value', '=', parameters('ADEncryptedPasswordHistorySize'), ',', 'Enforce password expiration protection;Value', '=', parameters('PasswordExpirationProtectionEnabled'), ',', 'Enforce automatic account management;Value', '=', parameters('AutomaticAccountManagementEnabled'), ',', 'Enforce automatic account management target;Value', '=', parameters('AutomaticAccountManagementTarget'), ',', 'Enforce automatic account name or prefix;Value', '=', parameters('AutomaticAccountManagementNameOrPrefix'), ',', 'Enforce automatic account name randomization;Value', '=', parameters('AutomaticAccountManagementRandomizeName'), ',', 'Enforce automatic account enablement;Value', '=', parameters('AutomaticAccountManagementEnableAccount')))]"
              }
            ]
          },
          "deployment": {
            "properties": {
              "mode": "incremental",
              "parameters": {
                "vmName": {
                  "value": "[field('name')]"
                },
                "location": {
                  "value": "[field('location')]"
                },
                "type": {
                  "value": "[field('type')]"
                },
                "assignmentName": {
                  "value": "SetLocalAdministratorPasswordSolution"
                },
                "BackupDirectory": {
                  "value": "[parameters('BackupDirectory')]"
                },
                "PasswordComplexity": {
                  "value": "[parameters('PasswordComplexity')]"
                },
                "PasswordLength": {
                  "value": "[parameters('PasswordLength')]"
                },
                "PassphraseLength": {
                  "value": "[parameters('PassphraseLength')]"
                },
                "PasswordAgeDays": {
                  "value": "[parameters('PasswordAgeDays')]"
                },
                "PostAuthenticationActions": {
                  "value": "[parameters('PostAuthenticationActions')]"
                },
                "PostAuthenticationResetDelay": {
                  "value": "[parameters('PostAuthenticationResetDelay')]"
                },
                "AdministratorAccountName": {
                  "value": "[parameters('AdministratorAccountName')]"
                },
                "ADPasswordEncryptionEnabled": {
                  "value": "[parameters('ADPasswordEncryptionEnabled')]"
                },
                "ADPasswordEncryptionPrincipal": {
                  "value": "[parameters('ADPasswordEncryptionPrincipal')]"
                },
                "ADEncryptedPasswordHistorySize": {
                  "value": "[parameters('ADEncryptedPasswordHistorySize')]"
                },
                "PasswordExpirationProtectionEnabled": {
                  "value": "[parameters('PasswordExpirationProtectionEnabled')]"
                },
                "AutomaticAccountManagementEnabled": {
                  "value": "[parameters('AutomaticAccountManagementEnabled')]"
                },
                "AutomaticAccountManagementTarget": {
                  "value": "[parameters('AutomaticAccountManagementTarget')]"
                },
                "AutomaticAccountManagementNameOrPrefix": {
                  "value": "[parameters('AutomaticAccountManagementNameOrPrefix')]"
                },
                "AutomaticAccountManagementRandomizeName": {
                  "value": "[parameters('AutomaticAccountManagementRandomizeName')]"
                },
                "AutomaticAccountManagementEnableAccount": {
                  "value": "[parameters('AutomaticAccountManagementEnableAccount')]"
                }
              },
              "template": {
                "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
                "contentVersion": "1.0.0.0",
                "parameters": {
                  "vmName": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "assignmentName": {
                    "type": "string"
                  },
                  "BackupDirectory": {
                    "type": "string"
                  },
                  "PasswordComplexity": {
                    "type": "string"
                  },
                  "PasswordLength": {
                    "type": "string"
                  },
                  "PassphraseLength": {
                    "type": "string"
                  },
                  "PasswordAgeDays": {
                    "type": "string"
                  },
                  "PostAuthenticationActions": {
                    "type": "string"
                  },
                  "PostAuthenticationResetDelay": {
                    "type": "string"
                  },
                  "AdministratorAccountName": {
                    "type": "string"
                  },
                  "ADPasswordEncryptionEnabled": {
                    "type": "string"
                  },
                  "ADPasswordEncryptionPrincipal": {
                    "type": "string"
                  },
                  "ADEncryptedPasswordHistorySize": {
                    "type": "string"
                  },
                  "PasswordExpirationProtectionEnabled": {
                    "type": "string"
                  },
                  "AutomaticAccountManagementEnabled": {
                    "type": "string"
                  },
                  "AutomaticAccountManagementTarget": {
                    "type": "string"
                  },
                  "AutomaticAccountManagementNameOrPrefix": {
                    "type": "string"
                  },
                  "AutomaticAccountManagementRandomizeName": {
                    "type": "string"
                  },
                  "AutomaticAccountManagementEnableAccount": {
                    "type": "string"
                  }
                },
                "resources": [
                  {
                    "condition": "[equals(toLower(parameters('type')), toLower('Microsoft.Compute/virtualMachines'))]",
                    "apiVersion": "2024-04-05",
                    "type": "Microsoft.Compute/virtualMachines/providers/guestConfigurationAssignments",
                    "name": "[concat(parameters('vmName'), '/Microsoft.GuestConfiguration/', parameters('assignmentName'))]",
                    "location": "[parameters('location')]",
                    "properties": {
                      "guestConfiguration": {
                        "name": "SetLocalAdministratorPasswordSolution",
                        "version": "1.*",
                        "assignmentType": "ApplyAndAutoCorrect",
                        "configurationParameter": [
                          {
                            "name": "Enforce password backup;Value",
                            "value": "[parameters('BackupDirectory')]"
                          },
                          {
                            "name": "Enforce password complexity;Value",
                            "value": "[parameters('PasswordComplexity')]"
                          },
                          {
                            "name": "Enforce minimum password length;Value",
                            "value": "[parameters('PasswordLength')]"
                          },
                          {
                            "name": "Enforce minimum passphrase length;Value",
                            "value": "[parameters('PassphraseLength')]"
                          },
                          {
                            "name": "Enforce password age in days;Value",
                            "value": "[parameters('PasswordAgeDays')]"
                          },
                          {
                            "name": "Enforce post-authentication actions;Value",
                            "value": "[parameters('PostAuthenticationActions')]"
                          },
                          {
                            "name": "Enforce post-authentication reset delay;Value",
                            "value": "[parameters('PostAuthenticationResetDelay')]"
                          },
                          {
                            "name": "Enforce administrator account name;Value",
                            "value": "[parameters('AdministratorAccountName')]"
                          },
                          {
                            "name": "Enforce password encryption;Value",
                            "value": "[parameters('ADPasswordEncryptionEnabled')]"
                          },
                          {
                            "name": "Enforce authorized password decryptors;Value",
                            "value": "[parameters('ADPasswordEncryptionPrincipal')]"
                          },
                          {
                            "name": "Enforce encrypted password history size;Value",
                            "value": "[parameters('ADEncryptedPasswordHistorySize')]"
                          },
                          {
                            "name": "Enforce password expiration protection;Value",
                            "value": "[parameters('PasswordExpirationProtectionEnabled')]"
                          },
                          {
                            "name": "Enforce automatic account management;Value",
                            "value": "[parameters('AutomaticAccountManagementEnabled')]"
                          },
                          {
                            "name": "Enforce automatic account management target;Value",
                            "value": "[parameters('AutomaticAccountManagementTarget')]"
                          },
                          {
                            "name": "Enforce automatic account name or prefix;Value",
                            "value": "[parameters('AutomaticAccountManagementNameOrPrefix')]"
                          },
                          {
                            "name": "Enforce automatic account name randomization;Value",
                            "value": "[parameters('AutomaticAccountManagementRandomizeName')]"
                          },
                          {
                            "name": "Enforce automatic account enablement;Value",
                            "value": "[parameters('AutomaticAccountManagementEnableAccount')]"
                          }
                        ]
                      }
                    }
                  },
                  {
                    "condition": "[equals(toLower(parameters('type')), toLower('Microsoft.HybridCompute/machines'))]",
                    "apiVersion": "2024-04-05",
                    "type": "Microsoft.HybridCompute/machines/providers/guestConfigurationAssignments",
                    "name": "[concat(parameters('vmName'), '/Microsoft.GuestConfiguration/', parameters('assignmentName'))]",
                    "location": "[parameters('location')]",
                    "properties": {
                      "guestConfiguration": {
                        "name": "SetLocalAdministratorPasswordSolution",
                        "version": "1.*",
                        "assignmentType": "ApplyAndAutoCorrect",
                        "configurationParameter": [
                          {
                            "name": "Enforce password backup;Value",
                            "value": "[parameters('BackupDirectory')]"
                          },
                          {
                            "name": "Enforce password complexity;Value",
                            "value": "[parameters('PasswordComplexity')]"
                          },
                          {
                            "name": "Enforce minimum password length;Value",
                            "value": "[parameters('PasswordLength')]"
                          },
                          {
                            "name": "Enforce minimum passphrase length;Value",
                            "value": "[parameters('PassphraseLength')]"
                          },
                          {
                            "name": "Enforce password age in days;Value",
                            "value": "[parameters('PasswordAgeDays')]"
                          },
                          {
                            "name": "Enforce post-authentication actions;Value",
                            "value": "[parameters('PostAuthenticationActions')]"
                          },
                          {
                            "name": "Enforce post-authentication reset delay;Value",
                            "value": "[parameters('PostAuthenticationResetDelay')]"
                          },
                          {
                            "name": "Enforce administrator account name;Value",
                            "value": "[parameters('AdministratorAccountName')]"
                          },
                          {
                            "name": "Enforce password encryption;Value",
                            "value": "[parameters('ADPasswordEncryptionEnabled')]"
                          },
                          {
                            "name": "Enforce authorized password decryptors;Value",
                            "value": "[parameters('ADPasswordEncryptionPrincipal')]"
                          },
                          {
                            "name": "Enforce encrypted password history size;Value",
                            "value": "[parameters('ADEncryptedPasswordHistorySize')]"
                          },
                          {
                            "name": "Enforce password expiration protection;Value",
                            "value": "[parameters('PasswordExpirationProtectionEnabled')]"
                          },
                          {
                            "name": "Enforce automatic account management;Value",
                            "value": "[parameters('AutomaticAccountManagementEnabled')]"
                          },
                          {
                            "name": "Enforce automatic account management target;Value",
                            "value": "[parameters('AutomaticAccountManagementTarget')]"
                          },
                          {
                            "name": "Enforce automatic account name or prefix;Value",
                            "value": "[parameters('AutomaticAccountManagementNameOrPrefix')]"
                          },
                          {
                            "name": "Enforce automatic account name randomization;Value",
                            "value": "[parameters('AutomaticAccountManagementRandomizeName')]"
                          },
                          {
                            "name": "Enforce automatic account enablement;Value",
                            "value": "[parameters('AutomaticAccountManagementEnableAccount')]"
                          }
                        ]
                      }
                    }
                  },
                  {
                    "condition": "[equals(toLower(parameters('type')), toLower('Microsoft.Compute/virtualMachineScaleSets'))]",
                    "apiVersion": "2024-04-05",
                    "type": "Microsoft.Compute/virtualMachineScaleSets/providers/guestConfigurationAssignments",
                    "name": "[concat(parameters('vmName'), '/Microsoft.GuestConfiguration/', parameters('assignmentName'))]",
                    "location": "[parameters('location')]",
                    "properties": {
                      "guestConfiguration": {
                        "name": "SetLocalAdministratorPasswordSolution",
                        "version": "1.*",
                        "assignmentType": "ApplyAndAutoCorrect",
                        "configurationParameter": [
                          {
                            "name": "Enforce password backup;Value",
                            "value": "[parameters('BackupDirectory')]"
                          },
                          {
                            "name": "Enforce password complexity;Value",
                            "value": "[parameters('PasswordComplexity')]"
                          },
                          {
                            "name": "Enforce minimum password length;Value",
                            "value": "[parameters('PasswordLength')]"
                          },
                          {
                            "name": "Enforce minimum passphrase length;Value",
                            "value": "[parameters('PassphraseLength')]"
                          },
                          {
                            "name": "Enforce password age in days;Value",
                            "value": "[parameters('PasswordAgeDays')]"
                          },
                          {
                            "name": "Enforce post-authentication actions;Value",
                            "value": "[parameters('PostAuthenticationActions')]"
                          },
                          {
                            "name": "Enforce post-authentication reset delay;Value",
                            "value": "[parameters('PostAuthenticationResetDelay')]"
                          },
                          {
                            "name": "Enforce administrator account name;Value",
                            "value": "[parameters('AdministratorAccountName')]"
                          },
                          {
                            "name": "Enforce password encryption;Value",
                            "value": "[parameters('ADPasswordEncryptionEnabled')]"
                          },
                          {
                            "name": "Enforce authorized password decryptors;Value",
                            "value": "[parameters('ADPasswordEncryptionPrincipal')]"
                          },
                          {
                            "name": "Enforce encrypted password history size;Value",
                            "value": "[parameters('ADEncryptedPasswordHistorySize')]"
                          },
                          {
                            "name": "Enforce password expiration protection;Value",
                            "value": "[parameters('PasswordExpirationProtectionEnabled')]"
                          },
                          {
                            "name": "Enforce automatic account management;Value",
                            "value": "[parameters('AutomaticAccountManagementEnabled')]"
                          },
                          {
                            "name": "Enforce automatic account management target;Value",
                            "value": "[parameters('AutomaticAccountManagementTarget')]"
                          },
                          {
                            "name": "Enforce automatic account name or prefix;Value",
                            "value": "[parameters('AutomaticAccountManagementNameOrPrefix')]"
                          },
                          {
                            "name": "Enforce automatic account name randomization;Value",
                            "value": "[parameters('AutomaticAccountManagementRandomizeName')]"
                          },
                          {
                            "name": "Enforce automatic account enablement;Value",
                            "value": "[parameters('AutomaticAccountManagementEnableAccount')]"
                          }
                        ]
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      }
    },
    "versions": [
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/87ed7fc8-023e-45fa-8315-a1e54c60188f",
  "name": "87ed7fc8-023e-45fa-8315-a1e54c60188f"
}

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