Unjoin VM’s from Azure AD before they are added to an AVD Host Pool.
On occasions, when using Sysprep to generalize an image, the device remains Azure AD Joined.
This causes that the AVD operation "Add virtual machines to a host pool" fail with error code 2700.
This feedback is to request that AVD scripts/code behind this operation can handle this scenario and unjoin the device from Azure AD before it gets domain joined.
You can find if a device is joined to Azure AD by checking the attribute AzureAdJoined after executing in the command prompt:
dsregcmd.exe /status
If it is, we must execute this other command to unjoin it: dsregcmd /leave /verbose /debug
This can be either before running Sysprep again and capturing the new image for AVD.
Or after the VM failed to get created in the hostpool. (Which requires us to join the VM in the domain and install the AVD agents manually).
The following message is seen when this issue happens:
'displayStatus': 'Provisioning failed',
'message': 'ERROR - Failed to join domain='contoso.com', ou='DC=contoso,DC=com', user='username@contoso.com', option='NetSetupJoinDomain' (#1 meaning 'User Specified without NetSetupAcctCreate'). Error code 2700'
This is the description of error code 2700:
This machine is already joined to a cloud domain and cannot be subsequently joined to an Active Directory domain
And this is the article we used as reference:
https://glennopedia.com/2017/02/08/the-machine-attempted-to-join-the-domain-but-failed-the-error-code-was-2700/
2 Comments
- TaniaMariscalMicrosoft Status changed:NewtoClosed
- TaniaMariscalMicrosoft We are sorry you are running into issues. To discuss issues we recommend to share your problem on our Tech Community forum (https://aka.ms/wvdtc) or open a support ticket after you have reviewed the troubleshooting options in our documentation (Windows Virtual Desktop troubleshooting overview - Azure | Microsoft Docs) We recommend to review our troubleshooting section first. The other option you have is to open a support ticket through the Azure Portal.