Skip to main content
Version: 1.0.0

Task 01: OU Creation & Pre-Creation Artifacts

Runbook Platform

DOCUMENT CATEGORY: Runbook
SCOPE: Active Directory preparation
PURPOSE: Create Azure Local OU and LCM user account
MASTER REFERENCE: Microsoft Learn - AD Prerequisites

Status: Active Estimated Time: 15 minutes Last Updated: 2026-01-31


Overview

Create the Azure Local OU container and LCM (Lifecycle Manager) user account using Microsoft's AsHciADArtifactsPreCreationTool.


Prerequisites

RequirementDescription
PermissionsCreate OU and user account in AD
ModuleAsHciADArtifactsPreCreationTool v2402+
info

AD structure should be defined during the planning phase. Update variables below for your environment.


Variables from variables.yml

Variable PathTypeDescription
identity.active_directory.ad_clusters_ou_pathstringOU path for Azure Local cluster computer objects
identity.active_directory.ad_domain_fqdnstringActive Directory domain FQDN
identity.accounts.account_lcm_usernamestringLifecycle Manager deployment account username
identity.accounts.account_lcm_passwordstringLCM account password (keyvault:// URI)
platform.kv_platform_namestringKey Vault name for secret retrieval
azure_vms.dc01.resource_groupstringResource group of the domain controller VM
azure_vms.dc01.namestringDomain controller VM name (for AzVM execution)
azure_vms.dc01.hostnamestringDomain controller hostname (for Arc execution)

Execution

Run directly on a domain controller or domain-joined machine with AD tools installed (e.g., RSAT).

# Adjust variable values for your environment; these are examples.

$lcm_password = '<password>' # Replace with a strong password for LCM user
$lcm_user = 'AzureLocalDeployUser' # LCM user name
$OuPath = "OU=AzureLocal-Cluster01,OU=AzureLocal,OU=Servers,DC=hybrid,DC=mgmt" # OU path

$password = ConvertTo-SecureString $lcm_password -AsPlainText -Force
$user = $lcm_user
$credential = New-Object System.Management.Automation.PSCredential ($user, $password)

if (-not (Get-Module -ListAvailable -Name AsHciADArtifactsPreCreationTool)) {
Install-Module AsHciADArtifactsPreCreationTool -Repository PSGallery -Force
}

if (-not (Get-KdsRootKey -ErrorAction SilentlyContinue)) {
Add-KdsRootKey -EffectiveTime (Get-Date).AddHours(-10)
}

New-HciAdObjectsPreCreation -AzureStackLCMUserCredential $credential -AsHciOUName $OuPath -Verbose

Verification

Run directly from a domain-joined machine or a session with AD tools installed (e.g., RDP into DC, jump box, or local RSAT).

# Verify OU was created
Get-ADOrganizationalUnit -LDAPFilter "(name=AzureLocal-Cluster01)" | Select-Object DistinguishedName

# Verify LCM user was created in OU
Get-ADUser -Identity "AzureLocalDeployUser" | Select-Object Name, DistinguishedName, Enabled

# Verify KDS Root Key exists
Get-KdsRootKey | Select-Object KeyId, EffectiveTime

Validation Checklist

  • AsHciADArtifactsPreCreationTool module installed (v2402+)
  • KDS Root Key exists
  • OU created with Block Inheritance enabled
  • LCM user created in OU
  • Credentials stored securely

Troubleshooting

IssueCauseResolution
New-ADOrganizationalUnit fails with access deniedInsufficient permissions to create OUsRun as Domain Admin or delegate OU creation rights on the parent container
KDS Root Key not effective immediatelyKey needs 10-hour replication delayUse -EffectiveImmediately in lab or wait 10 hours in production
AsHciADArtifactsPreCreationTool module not foundModule not installed or wrong PS versionInstall via Install-Module AsHciADArtifactsPreCreationTool on PowerShell 5.1+
LCM user creation fails with duplicateAccount already exists from prior attemptVerify existing account properties match requirements or remove and recreate

Next Steps

Proceed to Task 2 - Security Groups to create optional security groups.



Alternatives

The procedures in this task use the scripted methods shown in the tabs above. Additional deployment methods including Azure CLI and Bash scripts are available in the azurelocal-toolkit repository under scripts/deploy/.

MethodDescription
Azure CLIPowerShell-based Azure CLI scripts for Azure resource operations
BashLinux/macOS compatible shell scripts for pipeline environments
Phase 01: Active Directory↑ Part 3: On-Premises ReadinessTask 02: Security Groups →

Version Control

VersionDateAuthorChanges
1.02026-01-31Azure Local CloudInitial document
1.12026-03-03Azure Local CloudStandardized runbook format

End of Task