Microsoft Entra Join の Before / After

# はじめに
Microsoft Entra Join を実施する前と、した後で デバイス や クラウドの管理画面 での表示が どう変わるのかについて、情報をまとめました。

:::note info
Microsoft Entra Join については、以下の記事で説明していますので、参照してください。
（Microsoft Entra Join について）
　https://qiita.com/carol0226/items/8c2bbc0f480913eaeed4
（Microsoft Entra Join の手順 - Win10）
　https://qiita.com/carol0226/items/eba166a0a4b2e7df3a92
（Microsoft Entra Join の手順 - Win11）
　https://qiita.com/carol0226/items/74efd0c2cce7fc42e110
:::

# 1. Azure Portal の 表示
テナント内で、"参加済み" となっているデバイスの一覧を確認できます。

（確認方法）
1. Azure Portal に サインインする
1. "Microsoft Entra ID"  の 機能を開く
1. テナントの概要ページで「デバイス」を選択する
1. デバイスの概要ページで「すべてのデバイス」を選択する

## Before
デバイスはありません。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1619637/58ef0389-ead3-86cc-d338-11bfd8a83c4e.png)

## After
Win10 と Win11 という 2台 の デバイス が "参加済み" の状態
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1619637/daa7366d-a03b-e9b5-67a6-5e5dd17f7592.png)

# 2. デバイス の "参加済み" 状態 (GUI)
（確認方法）
1. デバイス に サインインする
1. 「スタートボタン」を右クリックして、「設定」を開く
1. 設定アプリ上 から「アカウント」を開く
1. アカウントの画面から「職場または学校へのアクセス」を開く

## Windows 10
### Before
"参加" 前の状態です。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1619637/2e2b3f2c-62d1-7e70-9e5f-229af2fbea7d.png)

### After 1
"参加済み" になった直後（再起動の前）
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1619637/ffb9ad30-17e5-0d36-409f-88bee6287fde.png)

### After 2
"参加済み" になり、デバイスを再起動して テナントユーザーで サインイン を実施
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1619637/379c5fef-a928-1eae-39af-00d3d1ea87bf.png)

## Windows 11
### Before
"参加" 前の状態です。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1619637/3d3033af-ff3d-1d37-01b7-3cd82f4709aa.png)

### After 1
"参加済み" になった直後（再起動の前）
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1619637/04d0d268-a22b-849f-79a5-26ec8de7446f.png)

### After 2
"参加済み" になり、デバイスを再起動して テナントユーザーで サインイン を実施
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/1619637/360ddb41-89a7-d661-e017-390406eb6ed3.png)

# 3. デバイス の "参加済み" 状態：dsregcmd コマンド
（確認方法）
1. デバイス に サインインする
1. コマンドプロンプトを開く
1. "dsregcmd /status" を実行する

## 結果一覧
| 章 | 項目 | Before | After 1 | After 2 |
|:-:|:-:|:-:|:-:|:-:|
|Device State|AzureAdJoined<br>EnterpriseJoined<br>DomainJoined| NO<br>NO<br>NO | YES<br>NO<br>NO | YES<br>NO<br>NO |
|Device Details|－|    |    |章が追加|
|Tenant Details|－|    |    |章が追加|
|User State|NgcSet<br>WorkplaceJoined<br>WamDefaultSet| NO<br>NO<br>NO | NO<br>NO<br>NO | NO<br>NO<br>YES |
|SSO State|AzureAdPrt<br>AzureAdPrtA～<br>EnterprisePrt<br>EnterprisePrt～<br>OnPremTgt<br>CloudTgt<br>KerbTopLeve～| NO<br>NO<br>NO<br>NO<br>無い<br>無い<br>無い| NO<br>空欄<br>NO<br>空欄<br>無い<br>無い<br>無い|YES<br>URL情報<br>NO<br>空欄<br>NO<br>YES<br>値が表示|
|Diagnostic Data|AadRecovery～<br>Executing Ac～<br>KeySignTest<br>DisplayNam～<br>OsVersionUp～<br>HostNameU～<br>Last HostNa～|   |NO<br>アカウント<br>PASSED<br>YES<br>YES<br>YES<br>NONE|NO<br>アカウント<br>PASSED<br>YES<br>YES<br>YES<br>NONE|
|IE Proxy<br>Config<br>for Current User|Auto Detect～<br>Auto-Con URL<br>Proxy Server～<br>Proxy Bypass～|YES<br>　<br>　<br>　|YES<br>　<br>　<br>　|YES<br>　<br>　<br>　|
|WinHttp Default<br>Proxy Config|Access Type|DIRECT|DIRECT|DIRECT|
|Ngc Prerequisite<br>Check|IsDeviceJoined<br>IsUserAzureAD<br>PolicyEnabled<br>PostLogonE～<br>DeviceEligible<br>SessionIsNot～<br>CertEnrollment<br>PreReqResult|NO<br>NO<br>NO<br>YES<br>NO<br>NO<br>none<br>WillNot～|YES<br>NO<br>NO<br>YES<br>NO<br>NO<br>none<br>WillNot～|YES<br>YES<br>YES<br>YES<br>NO<br>NO<br>none<br>WillNot～|

## 結果詳細

### Before
"参加" 前 の状態です。

"Device State" の "AzureAdJoined" の 値 が "NO" になっています。
~~~~
PS C:\Users\nogushu> dsregcmd /status

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

             AzureAdJoined : NO
          EnterpriseJoined : NO
              DomainJoined : NO
               Device Name : Win10

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

                    NgcSet : NO
           WorkplaceJoined : NO
             WamDefaultSet : NO

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

                AzureAdPrt : NO
       AzureAdPrtAuthority : NO
             EnterprisePrt : NO
    EnterprisePrtAuthority : NO

+----------------------------------------------------------------------+
| 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 : NO
             IsUserAzureAD : NO
             PolicyEnabled : NO
          PostLogonEnabled : YES
            DeviceEligible : NO
        SessionIsNotRemote : NO
            CertEnrollment : none
              PreReqResult : WillNotProvision

For more information, please visit https://www.microsoft.com/aadjerrors
~~~~

### After1
"参加済み" になった直後（再起動の前）

"Device State" の "AzureAdJoined" の 値 が "YES" に変わりました。
そのほかに "Device Details" と "Tenant Details" が追加されました。
~~~~
PS C:\Users\nogushu> dsregcmd /status

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

             AzureAdJoined : YES
          EnterpriseJoined : NO
              DomainJoined : NO
               Device Name : Win10

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

                  DeviceId : eadd81ba-xxxx-xxxx-xxxx-62axxxxefe15
                Thumbprint : ACCB4EXXXXXXXXXXA72F6ADXXXXXXXXXX208AE10
 DeviceCertificateValidity : [ 2023-11-25 01:13:55.000 UTC -- 2033-11-25 01:43:55.000 UTC ]
            KeyContainerId : 069d9016-xxxx-xxxx-xxxx-1aee4475fb04
               KeyProvider : Microsoft Software Key Storage Provider
              TpmProtected : NO
          DeviceAuthStatus : SUCCESS

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

                TenantName :
                  TenantId : 010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65
                       Idp : login.windows.net
               AuthCodeUrl : https://login.microsoftonline.com/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65/oauth2/authorize
            AccessTokenUrl : https://login.microsoftonline.com/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65/oauth2/token
                    MdmUrl :
                 MdmTouUrl :
          MdmComplianceUrl :
               SettingsUrl :
            JoinSrvVersion : 2.0
                JoinSrvUrl : https://enterpriseregistration.windows.net/EnrollmentServer/device/
                 JoinSrvId : urn:ms-drs:enterpriseregistration.windows.net
             KeySrvVersion : 1.0
                 KeySrvUrl : https://enterpriseregistration.windows.net/EnrollmentServer/key/
                  KeySrvId : urn:ms-drs:enterpriseregistration.windows.net
        WebAuthNSrvVersion : 1.0
            WebAuthNSrvUrl : https://enterpriseregistration.windows.net/webauthn/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65/
             WebAuthNSrvId : urn:ms-drs:enterpriseregistration.windows.net
    DeviceManagementSrvVer : 1.0
    DeviceManagementSrvUrl : https://enterpriseregistration.windows.net/manage/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65/
     DeviceManagementSrvId : urn:ms-drs:enterpriseregistration.windows.net

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

                    NgcSet : NO
           WorkplaceJoined : NO
             WamDefaultSet : NO

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

                AzureAdPrt : NO
       AzureAdPrtAuthority :
             EnterprisePrt : NO
    EnterprisePrtAuthority :

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

        AadRecoveryEnabled : NO
    Executing Account Name : Win10\nogushu
               KeySignTest : PASSED

        DisplayNameUpdated : YES
          OsVersionUpdated : YES
           HostNameUpdated : YES

      Last HostName Update : NONE

+----------------------------------------------------------------------+
| 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 : NO
        SessionIsNotRemote : NO
            CertEnrollment : none
              PreReqResult : WillNotProvision

For more information, please visit https://www.microsoft.com/aadjerrors
~~~~

### After 2
"参加済み" になり、デバイスを再起動して テナントユーザーで サインイン を実施
~~~~
PS C:\Windows\system32> dsregcmd /status

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

             AzureAdJoined : YES
          EnterpriseJoined : NO
              DomainJoined : NO
               Device Name : Win10

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

                  DeviceId : 010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65
                Thumbprint : ACCB4EXXXXXXXXXXA72F6ADXXXXXXXXXX208AE10
 DeviceCertificateValidity : [ 2023-11-25 01:13:55.000 UTC -- 2033-11-25 01:43:55.000 UTC ]
            KeyContainerId : 069d9016-xxxx-xxxx-xxxx-1aexxxx5fb04
               KeyProvider : Microsoft Software Key Storage Provider
              TpmProtected : NO
          DeviceAuthStatus : SUCCESS

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

                TenantName :
                  TenantId : 010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65
                       Idp : login.windows.net
               AuthCodeUrl : https://login.microsoftonline.com/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65/oauth2/authorize
            AccessTokenUrl : https://login.microsoftonline.com/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65/oauth2/token
                    MdmUrl :
                 MdmTouUrl :
          MdmComplianceUrl :
               SettingsUrl :
            JoinSrvVersion : 2.0
                JoinSrvUrl : https://enterpriseregistration.windows.net/EnrollmentServer/device/
                 JoinSrvId : urn:ms-drs:enterpriseregistration.windows.net
             KeySrvVersion : 1.0
                 KeySrvUrl : https://enterpriseregistration.windows.net/EnrollmentServer/key/
                  KeySrvId : urn:ms-drs:enterpriseregistration.windows.net
        WebAuthNSrvVersion : 1.0
            WebAuthNSrvUrl : https://enterpriseregistration.windows.net/webauthn/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65/
             WebAuthNSrvId : urn:ms-drs:enterpriseregistration.windows.net
    DeviceManagementSrvVer : 1.0
    DeviceManagementSrvUrl : https://enterpriseregistration.windows.net/manage/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65/
     DeviceManagementSrvId : urn:ms-drs:enterpriseregistration.windows.net

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

                    NgcSet : NO
           WorkplaceJoined : NO
             WamDefaultSet : YES
       WamDefaultAuthority : organizations
              WamDefaultId : https://login.microsoft.com
            WamDefaultGUID : {B16898C6-xxxx-xxxx-xxxx-64DxxxxA8520} (AzureAd)

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

                AzureAdPrt : YES
      AzureAdPrtUpdateTime : 2023-11-25 02:23:11.000 UTC
      AzureAdPrtExpiryTime : 2023-12-09 02:23:10.000 UTC
       AzureAdPrtAuthority : https://login.microsoftonline.com/010d28ee-xxxx-xxxx-xxxx-9a7xxxx3dc65
             EnterprisePrt : NO
    EnterprisePrtAuthority :
                 OnPremTgt : NO
                  CloudTgt : YES
         KerbTopLevelNames : .windows.net,.windows.net:1433,.windows.net:3342,.azure.net,.azure.net:1433,.azure.net:3342

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

        AadRecoveryEnabled : NO
    Executing Account Name : AzureAD\AvdAdmin, avdadmin@carol226.com
               KeySignTest : PASSED

        DisplayNameUpdated : YES
          OsVersionUpdated : YES
           HostNameUpdated : YES

      Last HostName Update : NONE

+----------------------------------------------------------------------+
| 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 : YES
             PolicyEnabled : YES
          PostLogonEnabled : YES
            DeviceEligible : NO
        SessionIsNotRemote : NO
            CertEnrollment : none
              PreReqResult : WillNotProvision

For more information, please visit https://www.microsoft.com/aadjerrors
~~~~

# こちらも参考になります

https://learn.microsoft.com/ja-jp/entra/identity/devices/troubleshoot-device-dsregcmd?wt.mc_id=mvp_407731