Set-AzureRmVMADDomainExtension fails to add VM to AD Domain

1

The below VM extension fails to add VM to the domain.

It works fine when the ‘Computer Account’ exists in the AD. If the ‘Computer Account’ do not exist (New Server) it fails.

Set-AzureRmVMADDomainExtension -TypeHandlerVersion '1.0' -JoinOption 3 -DomainName $strDomainDNSName -ResourceGroupName $strRes_GrpName -VMName $strHostName -Credential $objCred -OUPath $strServerOU -Restart

The join option 3 should complete the below actions.

Value Meaning NETSETUP_JOIN_DOMAIN 0x00000001 Joins the computer to a domain. If this value is not specified, joins the computer to a workgroup. NETSETUP_ACCT_CREATE 0x00000002 Creates the account on the domain.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa370433(v=vs.85).aspx

Found the below error details under Azure VM Extension:

[

{
    "code": "ComponentStatus/JoinDomainException for Option 3 meaning 'User Specified'/failed/1",
    "displayStatus": "Provisioning failed",
    "level": "Error",
    "message": "ERROR - Failed to join domain='MyAd.ad.company.co.uk', ou='OU=Computers,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk', user='LocalAdmin@MyAD.ad.company.co.uk', option='NetSetupJoinDomain, NetSetupAcctCreate' (#3 meaning 'User Specified'). Error code 2",
    "time": null
}

{
    "code": "ComponentStatus/JoinDomainException for Option 1 meaning 'User Specified without NetSetupAcctCreate'/failed/1",
    "displayStatus": "Provisioning failed",
    "level": "Error",
    "message": "ERROR - Failed to join domain='MyAd.ad.company.co.uk', ou='OU=Computers,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk', user='MGTAdmin@MyAd.ad.company.co.uk', option='NetSetupJoinDomain' (#1 meaning 'User Specified without NetSetupAcctCreate'). Error code 1332",
    "time": null
}

]

json
azure
asked on Stack Overflow Nov 29, 2016 by Jenson Joseph

2 Answers

2

Only the Built-in 'Computers' OU has the problem. Tried both 'OU=Computers,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk' and 'CN=Computers,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk'. Failed with same Error.

But other user created OU works fine. For Eg. 'OU=TSTVLAN,OU=MGTServers,,DC=MyAd,DC=ad,DC=company,DC=co,DC=uk'

answered on Stack Overflow Nov 29, 2016 by Jenson Joseph
0

Mine was failing with "User Specified without NetSetupAcctCreate", error 1323 in the logs. I needed to update the username to include the domain, ie User= 'domainName\userName' Then it worked.

answered on Stack Overflow Jul 19, 2019 by jlo-gmail

User contributions licensed under CC BY-SA 3.0