Skip to main content

Get the Tenant ID of an Azure/Entra Joined PC

To get the Tenant ID of the Azure Joined PC, or confirm it is joined to Azure;

  1. Open Windows PowerShell.
  2. Enter dsregcmd /status.
  3. Verify that AzureAdJoined is set to YES.

OUTPUT

PS C:\WINDOWS\system32> dsregcmd /status

+----------------------------------------------------------------------+
| Device State                                                         |
+----------------------------------------------------------------------+

             AzureAdJoined : YES
          EnterpriseJoined : NO
              DomainJoined : NO
           Virtual Desktop : NOT SET
               Device Name : GHJM2J3

+----------------------------------------------------------------------+
| Device Details                                                       |
+----------------------------------------------------------------------+

                  DeviceId : 0x00x00x-000x-00xx-xx0x-0000xx0x0000
                Thumbprint : 55665AE1CC416BE201812EFF02192A1DD1564BEA
 DeviceCertificateValidity : [ 2022-12-11 17:07:16.000 UTC -- 2032-12-11 17:37:16.000 UTC ]
            KeyContainerId : 0x00x00x-000x-00xx-xx0x-0000xx0x0000
               KeyProvider : Microsoft Platform Crypto Provider
              TpmProtected : YES
          DeviceAuthStatus : SUCCESS

+----------------------------------------------------------------------+
| Tenant Details                                                       |
+----------------------------------------------------------------------+

                TenantName : COMPANY, INC.
                  TenantId : 0x00x00x-000x-00xx-xx0x-0000xx0x0000
AuthCodeUrl : https://login.microsoftonline.com/0x00x00x-000x-00xx-xx0x-0000xx0x0000/oauth2/authorize
AccessTokenUrl : https://login.microsoftonline.com/0x00x00x-000x-00xx-xx0x-0000xx0x0000/oauth2/token
MdmUrl : https://enrollment.manage.microsoft.com/enrollmentserver/discovery.svc
MdmTouUrl : https://portal.manage.microsoft.com/TermsofUse.aspx
MdmComplianceUrl : https://portal.manage.microsoft.com/?portalAction=Compliance
               SettingsUrl : eyJVcmlzIjpbImh0dHBzOi8va2FpbGFuaS5vbmUubWljcm9zb2Z0LmNvbS8iLCJodHRwczovL2thaWxhbmkxLm9uZS5taWNyb3NvZnQuY29tLyJdfQ==


+----------------------------------------------------------------------+
| User State                                                           |
+----------------------------------------------------------------------+

                    NgcSet : NO
           WorkplaceJoined : NO
             WamDefaultSet : ERROR (0x80070520)


| SSO State                                                            |
+----------------------------------------------------------------------+

                AzureAdPrt : NO
       AzureAdPrtAuthority :
             EnterprisePrt : NO
    EnterprisePrtAuthority :

+----------------------------------------------------------------------+
| Diagnostic Data                                                      |
+----------------------------------------------------------------------+

        AadRecoveryEnabled : NO
    Executing Account Name : WORKGROUP\COMPUTER$
               KeySignTest : PASSED

        DisplayNameUpdated : Managed by MDM
          OsVersionUpdated : Managed by MDM
           HostNameUpdated : YES

      Last HostName Update : SUCCESS
               Client Time : 2023-01-31 05:42:05.000 UTC
                Request ID : 0x00x00x-000x-00xx-xx0x-0000xx0x0000
               Server Time : 01-31-2023 5:42:05Z
               HTTP Status : 200
            Server Message : The attribute 'hostnames' value(s) were successfully updated

+----------------------------------------------------------------------+
| IE Proxy Config for Current User                                     |
+----------------------------------------------------------------------+


      Auto Detect Settings : YES
    Auto-Configuration URL :
         Proxy Server List :
         Proxy Bypass List :

+----------------------------------------------------------------------+
| WinHttp Default Proxy Config                                         |
+----------------------------------------------------------------------+

               Access Type : DIRECT


| Ngc Prerequisite Check                                               |
+----------------------------------------------------------------------+

            IsDeviceJoined : YES
             IsUserAzureAD : NO
             PolicyEnabled : NO
          PostLogonEnabled : YES
            DeviceEligible : YES
        SessionIsNotRemote : YES
            CertEnrollment : none
              PreReqResult : WillNotProvision

For more information, please visit https://www.microsoft.com/aadjerrors
PS C:\WINDOWS\system32>

 



Source: https://learn.microsoft.com/en-us/azure/active-directory/devices/howto-hybrid-join-verify