question

MarkLawrence-0861 avatar image
0 Votes"
MarkLawrence-0861 asked ·

Disconnect Datacenter VM from Azure Active Directory

I am trying to connect an Azure 2019 Datacentre VM that we currently have to either an AAD in another subscription. I have setup a peering between the AADVnet and the VM VNet.

I can now attempt to connect to the server with that AAD. However the server comes back with the error whilst attempting to connect to the domain

' This device is joined to Azure AD...and choose to disconnect your device from your work or school'

I did not ask for the VM to be connected to an Azure domain. AADloginFor Windows extension was installed when I first created the VM. I cannot seem to disconnect it from the Azure domain although it is in its own workgroup. If I go into Settings and About there is no option to remove it from the existing Azure AD (even though it is not setup in this subscription) . I have even renamed the computer back to it's orginal name.

How do I remove the VM from the Azure domain?

Thanks

azure-active-directoryazure-virtual-machines
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please "Accept as answer" if the answer provided below helped you. It will help others in the community looking for similar information.

0 Votes 0 · ·

1 Answer

amanpreetsingh-msft avatar image
5 Votes"
amanpreetsingh-msft answered ·

@marklawrence-0861 Run the DSRegCmd /Status cmd, you should see AzureAdJoined : YES in the output under Device State section as shown below:

          AzureAdJoined : YES
       EnterpriseJoined : NO
           DomainJoined : NO

In order to disjoin the machine from Azure AD, you need to run DSRegCmd /Leave in elevated command window. Logout and Log back in to the server and run DSRegCmd /Status again to confirm if you are getting AzureAdJoined : NO in the output.


Please "Accept as answer" wherever the information provided helps you to help others in the community.

· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This worked Perfect Thanks!

0 Votes 0 · ·