The Set-AzVMADDomainExtension cmdlet adds a Microsoft Entra ID virtual machine extension to a virtual machine.
This extension lets your virtual machine join a domain.
Examples
Example 1
# Create a Resource Group and Virtual Machine before this.
$extensionName = "extensionName"
$virtualMachineName = "vmName"
$resourceGroupName = "resourceGroupName"
$domainName = "domain.com"
Set-AzVMADDomainExtension -ResourceGroupName $resourceGroupName -VMName $virtualMachineName -Name $extensionName -DomainName $domainName
RequestId IsSuccessStatusCode StatusCode ReasonPhrase
--------- ------------------- ---------- ------------
True OK OK
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Specifies the user name and password for the virtual machine as a PSCredential object.
To obtain a credential, use the Get-Credential cmdlet.
For more information, type Get-Help Get-Credential.
Indicates that this cmdlet forces a rerun of the same extension configuration on the virtual machine without uninstalling and reinstalling the extension.
The value can be any string different from the current value.
If forceUpdateTag is not changed, updates to public or protected settings are still applied by the handler.
Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism.
Specifies an organizational unit (OU) for the domain account.
Enter the full distinguished name of the OU in quotation marks.
The default value is the default OU for machine objects in the domain.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.