验证 Microsoft Entra 混合加入

下面是查找和验证混合联接设备状态的三种方法:

在设备本地

  1. 打开 Windows PowerShell。
  2. 输入 dsregcmd /status
  3. 确保“AzureAdJoined”和“DomainJoined”均设置为“是”。
  4. 可以使用 DeviceId,并使用 Microsoft Entra管理中心或 PowerShell 比较服务的状态。

对于下层设备,请参阅排查已加入 Microsoft Entra 混合域的下层设备的问题一文

使用 Microsoft Entra 管理中心

  1. 至少以云设备管理员身份登录到 Microsoft Entra 管理中心
  2. 浏览到“标识”>“设备”>“所有设备”。
  3. 如果“已注册”列显示“挂起”,则表示 Microsoft Entra 混合加入尚未完成。 在联合环境中,只有当注册失败并且 Microsoft Entra Connect 配置为同步设备时,才会出现此状态。 等待 Microsoft Entra Connect 完成同步周期。
  4. 如果“已注册”列包含日期/时间,则表示 Microsoft Entra 混合加入已完成。

使用 PowerShell

使用 Get-MgDevice 验证 Azure 租户中的设备注册状态。 此 cmdlet 位于 Microsoft Graph PowerShell SDK 中。

使用 Get-MgDevice cmdlet 检查服务详细信息时

  • 必须存在其设备 ID 与 Windows 客户端上的 ID 相匹配的对象。
  • DeviceTrustType 的值为 Domain Joined。 此设置相当于 Microsoft Entra 管理中心内的“设备”页上的“已进行 Microsoft Entra 混合联接”状态
  • 对于条件访问中使用的设备,Enabled 的值为 TrueDeviceTrustLevel 的值为 Managed
  1. 以管理员身份打开 Windows PowerShell。
  2. 输入 Connect-MgGraph 可连接到 Azure 租户。

统计所有已加入 Microsoft Entra 混合域的设备(不包括“挂起”状态)

(Get-MgDevice -All | where {($_.TrustType -eq 'ServerAd') -and ($_.ProfileType -eq 'RegisteredDevice')}).count

统计所有已加入 Microsoft Entra 混合域的设备(包括“挂起”状态)

(Get-MgDevice -All | where {($_.TrustType -eq 'ServerAd') -and ($_.ProfileType -ne 'RegisteredDevice')}).count

列出所有已加入 Microsoft Entra 混合域的设备

Get-MgDevice -All | where {($_.TrustType -eq 'ServerAd') -and ($_.ProfileType -eq 'RegisteredDevice')}

列出所有已加入 Microsoft Entra 混合域的设备(包括“挂起”状态)

Get-MgDevice -All | where {($_.TrustType -eq 'ServerAd') -and ($_.ProfileType -ne 'RegisteredDevice')}

列出单个设备的详细信息:

  1. 输入以下命令。 在设备上本地获取设备 ID。

    $Device = Get-MgDevice -DeviceId <ObjectId>
    
  2. 验证 AccountEnabled 是否设置为 True

    $Device.AccountEnabled
    

后续步骤