Join a VM to an existing domain

Last updated: 5/12/2017

Cost estimate

$134.0577000000

Estimated monthly cost

Understand how this was calculated and customize to your needs

Pricing calculator

This template demonstrates domain join to a private AD domain up in cloud.

This Azure Resource Manager template was created by a member of the community and not by Microsoft. Each Resource Manager template is licensed to you under a license agreement by its owner, not Microsoft. Microsoft is not responsible for Resource Manager templates provided and licensed by community members and does not screen for security, compatibility, or performance. Community Resource Manager templates are not supported under any Microsoft support program or service, and are made available AS IS without warranty of any kind.

Parameters

Parameter Name Description
existingVNETName Existing VNET that contains the domain controller
existingSubnetName Existing subnet that contains the domain controller
dnsLabelPrefix Unique public DNS prefix for the deployment. The fqdn will look something like '<dnsname>.westus.cloudapp.azure.com'. Up to 62 chars, digits or dashes, lowercase, should start with a letter: must conform to '^[a-z][a-z0-9-]{1,61}[a-z0-9]$'.
vmSize The size of the virtual machines
domainToJoin The FQDN of the AD domain
domainUsername Username of the account on the domain
domainPassword Password of the account on the domain
ouPath Specifies an organizational unit (OU) for the domain account. Enter the full distinguished name of the OU in quotation marks. Example: 'OU=testOU; DC=domain; DC=Domain; DC=com
domainJoinOptions Set of bit flags that define the join options. Default value of 3 is a combination of NETSETUP_JOIN_DOMAIN (0x00000001) & NETSETUP_ACCT_CREATE (0x00000002) i.e. will join the domain and create the account on the domain. For more information see https://msdn.microsoft.com/en-us/library/aa392154(v=vs.85).aspx
vmAdminUsername The name of the administrator of the new VM and the domain. Exclusion list: 'admin','administrator
vmAdminPassword The password for the administrator account of the new VM and the domain

Use the template

PowerShell

New-AzureRmResourceGroupDeployment -Name <deployment-name> -ResourceGroupName <resource-group-name> -TemplateUri https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/201-vm-domain-join/azuredeploy.json
Install and configure Azure PowerShell

Command line

azure config mode arm
azure group deployment create <my-resource-group> <my-deployment-name> --template-uri https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/201-vm-domain-join/azuredeploy.json
Install and Configure the Azure Cross-Platform Command-Line Interface