I want to domain join a HyperV based Windows 11 VM to a AAD Domain. I am an admin of this VM and admin of the tenant to which I want to AAD domain join. Say by tenant/domain is abc.onmicrosoft.com
and I am the user [email protected]
.
I thought this would be pretty straight forward but been surprisingly difficult to do. I have tried using Add-Computer -DomainName abc.onmicrosoft.com
but I get,
Add-Computer : Computer 'DESKTOP-MJTQITV' failed to join domain 'abc.onmicrosoft.com' from its current workgroup
'WORKGROUP' with following error message: The specified domain either does not exist or could not be contacted.
At line:1 char:1
+ Add-Computer -DomainName abc.onmicrosoft.com
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (DESKTOP-MJTQITV:String) [Add-Computer], InvalidOperation
I have read other blogs but most are related to Hybrid or AD Join but I am looking for AAD Join.