Disconnect Datacenter VM from Azure Active Directory

Mark Lawrence 21 Reputation points
2020-01-17T13:26:07.937+00:00

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 Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,127 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,466 questions
{count} votes

2 answers

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,306 Reputation points
    2020-01-18T07:14:59.533+00:00

    @Mark Lawrence 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.

    31 people found this answer helpful.

  2. Steve Hulsberg 6 Reputation points
    2022-02-04T19:28:31.217+00:00

    Super simple and it solved my issue. Thank you so much. Wish I would of found this sooner!

    1 person found this answer helpful.
    0 comments No comments