Domain join extension issue

%3CLINGO-SUB%20id%3D%22lingo-sub-2689725%22%20slang%3D%22en-US%22%3EDomain%20join%20extension%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2689725%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20anyone%20else%20having%20issues%20in%20using%20the%20domain%20join%20VM%20extension%3F%20It%20was%20working%20fine%20for%20me%20until%20a%20couple%20of%20days%20ago.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20using%20it%20in%20an%20AVD%20environment%20and%20it%20suddenly%20stopped%20working.%20Same%20with%20script%20or%20adding%20AVD%20hosts%20in%20the%20portal%20(which%20uses%20the%20extension%20anyway).%20I%20started%20to%20trace%20through%20all%20the%20possible%20issues%2C%20DNS%20resolution%20and%20so%20on.%20I%20can%20always%20join%20manually%20by%20logging%20in%20to%20the%20VM%20and%20manually%20joining%20-%20that%20works.%20But%20when%20I%20use%20the%20extension%20it%20never%20works%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20even%20created%20a%20brand%20new%20tenant%20with%20just%20a%20single%20vnet%2C%20and%20two%20VMs.%20Promoted%20one%20to%20a%20DC.%20DNS%20set%20on%20the%20vnet%20to%20be%20the%20IP%20of%20the%20domain%20controller.%20No%20public%20internet%20access%20to%20either%20VM%2C%20Bastion%20setup%20for%20accessing%20the%20VMs.%20Attempted%20to%20join%20the%20second%20to%20the%20domain%2C%20same%20error.%20On%20the%20non-joined%20VM%20I%20can%20ping%20the%20domain%2C%20ping%20the%20DC%20by%20name%20(I%20manually%20set%20the%20domain%20suffix%20on%20the%20adapter%20to%20-%20makes%20no%20difference)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20tried%20with%20Azure%20CLI%20as%20well%20as%20Azure%20PowerShell.%20Here%20is%20my%20Azure%20CLI%20command%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Eaz%20vm%20extension%20set%20--name%20JsonADDomainExtension%20%5C%0A%20%20%20%20%20%20%20%20--publisher%20Microsoft.Compute%20%5C%0A%20%20%20%20%20%20%20%20--version%201.3%20%5C%0A%20%20%20%20%20%20%20%20--no-auto-upgrade%20%5C%0A%20%20%20%20%20%20%20%20--vm-name%20vmtemp2%20%5C%0A%20%20%20%20%20%20%20%20--resource-group%20rg-sharedservices-ad-uksouth%20%5C%0A%20%20%20%20%20%20%20%20--settings%20'%7B%22Name%22%3A%22mydomain.local%22%2C%22OUPath%22%3A%22OU%3DEUC%2CDC%3Dmydomain%2CDC%3Dlocal%22%2C%22user%22%3A%22avdjoin%40mydomain.local%22%2C%22restart%22%3A%22true%22%2C%22options%22%3A%223%22%7D'%20%5C%0A%20%20%20%20%20%20%20%20--protected-settings%20'%7B%22password%22%3A%22mysecretpassword%22%7D'%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EThis%20is%20what%20is%20in%20the%20extension%20log%20at%20C%3A%5CWindowsAzure%5CLogs%5CPlugins%5CMicrosoft.Compute.JsonADDomainExtension%5C1.3.6%5CADDomainExtension.log%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3ECurrent%20domain%3A%20%20()%2C%20current%20workgroup%3A%20WORKGROUP%2C%20IsDomainJoin%3A%20True%2C%20Target%20Domain%2FWorkgroup%3A%20mydomain.local.%0A2021-08-26T19%3A30%3A53.0794566Z%20%5BInfo%5D%3A%20Domain%20Join%20Path.%0A2021-08-26T19%3A30%3A53.0794566Z%20%5BInfo%5D%3A%20Current%20Domain%20name%20is%20empty%2Fnull.%20Try%20to%20get%20Local%20domain%20name.%0A2021-08-26T19%3A30%3A53.0794566Z%20%5BInfo%5D%3A%20In%20AD%20Domain%20extension%20process%2C%20the%20local%20domain%20is%3A%20''.%0A2021-08-26T19%3A30%3A53.0950819Z%20%5BInfo%5D%3A%20Domain%20Join%20will%20be%20performed.%0A2021-08-26T19%3A30%3A53.8606579Z%20%5BError%5D%3A%20Try%20join%3A%20domain%3D'mydomain.local'%2C%20ou%3D'OU%3DEUC%2CDC%3Dmydomain%2CDC%3Dlocal'%2C%20user%3D'avdjoin%40mydomain.local'%2C%20option%3D'NetSetupJoinDomain%2C%20NetSetupAcctCreate'%20(%233%3AUser%20Specified)%2C%20errCode%3D'2'.%0A2021-08-26T19%3A30%3A53.8762845Z%20%5BError%5D%3A%20Setting%20error%20code%20to%2053%20while%20joining%20domain%0A2021-08-26T19%3A30%3A54.4704048Z%20%5BError%5D%3A%20Try%20join%3A%20domain%3D'mydomain.local'%2C%20ou%3D'OU%3DEUC%2CDC%3Dmydomain%2CDC%3Dlocal'%2C%20user%3D'avdjoin%40mydomain.local'%2C%20option%3D'NetSetupJoinDomain'%20(%231%3AUser%20Specified%20without%20NetSetupAcctCreate)%2C%20errCode%3D'1332'.%0A2021-08-26T19%3A30%3A54.4704048Z%20%5BError%5D%3A%20Setting%20error%20code%20to%2053%20while%20joining%20domain%0A2021-08-26T19%3A30%3A54.4704048Z%20%5BError%5D%3A%20Computer%20failed%20to%20join%20domain%20'mydomain.local'%20from%20workgroup%20'WORKGROUP'.%0A2021-08-26T19%3A30%3A54.4704048Z%20%5BInfo%5D%3A%20Retrying%20action%20after%2015%20seconds%2C%20at%20attempt%201%20out%20of%20'10'.%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhatever%20I%20try%20-%20I%20get%20the%20errors%20above.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2692500%22%20slang%3D%22en-US%22%3ERe%3A%20Domain%20join%20extension%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2692500%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20seems%20to%20be%20happening%20because%20I%20have%20spaces%20in%20my%20OU%20Path%20value.%20If%20I%20create%20an%20OU%20without%20spaces%20in%20the%20name%20it%20works.%20Unfortunately%20the%20OU%20into%20which%20machines%20will%20be%20going%20pre-exists%20and%20I%20can't%20rename%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Is anyone else having issues in using the domain join VM extension? It was working fine for me until a couple of days ago.

 

I was using it in an AVD environment and it suddenly stopped working. Same with script or adding AVD hosts in the portal (which uses the extension anyway). I started to trace through all the possible issues, DNS resolution and so on. I can always join manually by logging in to the VM and manually joining - that works. But when I use the extension it never works now.

 

I even created a brand new tenant with just a single vnet, and two VMs. Promoted one to a DC. DNS set on the vnet to be the IP of the domain controller. No public internet access to either VM, Bastion setup for accessing the VMs. Attempted to join the second to the domain, same error. On the non-joined VM I can ping the domain, ping the DC by name (I manually set the domain suffix on the adapter to - makes no difference)

 

I have tried with Azure CLI as well as Azure PowerShell. Here is my Azure CLI command:-

 

az vm extension set --name JsonADDomainExtension \
        --publisher Microsoft.Compute \
        --version 1.3 \
        --no-auto-upgrade \
        --vm-name vmtemp2 \
        --resource-group rg-sharedservices-ad-uksouth \
        --settings '{"Name":"mydomain.local","OUPath":"OU=EUC,DC=mydomain,DC=local","user":"avdjoin@mydomain.local","restart":"true","options":"3"}' \
        --protected-settings '{"password":"mysecretpassword"}'

This is what is in the extension log at C:\WindowsAzure\Logs\Plugins\Microsoft.Compute.JsonADDomainExtension\1.3.6\ADDomainExtension.log

 

Current domain:  (), current workgroup: WORKGROUP, IsDomainJoin: True, Target Domain/Workgroup: mydomain.local.
2021-08-26T19:30:53.0794566Z	[Info]:	Domain Join Path.
2021-08-26T19:30:53.0794566Z	[Info]:	Current Domain name is empty/null. Try to get Local domain name.
2021-08-26T19:30:53.0794566Z	[Info]:	In AD Domain extension process, the local domain is: ''.
2021-08-26T19:30:53.0950819Z	[Info]:	Domain Join will be performed.
2021-08-26T19:30:53.8606579Z	[Error]:	Try join: domain='mydomain.local', ou='OU=EUC,DC=mydomain,DC=local', user='avdjoin@mydomain.local', option='NetSetupJoinDomain, NetSetupAcctCreate' (#3:User Specified), errCode='2'.
2021-08-26T19:30:53.8762845Z	[Error]:	Setting error code to 53 while joining domain
2021-08-26T19:30:54.4704048Z	[Error]:	Try join: domain='mydomain.local', ou='OU=EUC,DC=mydomain,DC=local', user='avdjoin@mydomain.local', option='NetSetupJoinDomain' (#1:User Specified without NetSetupAcctCreate), errCode='1332'.
2021-08-26T19:30:54.4704048Z	[Error]:	Setting error code to 53 while joining domain
2021-08-26T19:30:54.4704048Z	[Error]:	Computer failed to join domain 'mydomain.local' from workgroup 'WORKGROUP'.
2021-08-26T19:30:54.4704048Z	[Info]:	Retrying action after 15 seconds, at attempt 1 out of '10'.

 

Whatever I try - I get the errors above.

 

1 Reply

This seems to be happening because I have spaces in my OU Path value. If I create an OU without spaces in the name it works. Unfortunately the OU into which machines will be going pre-exists and I can't rename it.