使用 Azure Active Directory (Azure AD) 中的设备管理,可以确保用户从满足安全性和符合性标准的设备访问资源。 有关详细信息,请参阅 Azure Active Directory 中的设备管理简介。
Tip: 如果使用 Azure AD Connect 是合适的选项,请参阅托管域或联合域的相关教程。 使用 Azure AD Connect,可以大大简化混合 Azure AD 加入配置。
如果你有本地 Active Directory 环境,并且想要将已加入域的设备联接到 Azure AD,则可以通过配置联接到混合 Azure AD 的设备来实现。 在本教程中,你将了解如何执行以下操作:
- 手动配置混合 Azure AD 加入
- 配置服务连接点
- 设置声明颁发
- 启用 Windows 下层设备
- 验证联接的设备
- 对实现进行故障排除
先决条件
本教程假定你熟悉以下内容:
在组织中开始启用已加入混合 Azure AD 的设备之前,请确保:
- 运行的是最新版本的 Azure AD Connect。
- Azure AD Connect 已将要加入混合 Azure AD 的设备的计算机对象同步到 Azure AD。 如果这些计算机对象属于特定组织单位 (OU),则也需要在 Azure AD Connect 中配置这些 OU 以进行同步。
Azure AD Connect:
- 保留本地 Active Directory 实例中的计算机帐户与 Azure AD 中的设备对象之间的关联。
- 启用与设备相关的其他功能,例如 Windows Hello for Business。
请确保可从组织网络内的计算机访问以下 URL,以便将计算机注册到 Azure AD:
https://enterpriseregistration.windows.nethttps://login.microsoftonline.comhttps://device.login.microsoftonline.com- 组织的 STS(适用于联盟域),应包含在用户的本地 Intranet 设置中
Warning: 如果组织使用针对数据丢失防护或 Azure AD 租户限制等方案拦截 SSL 流量的代理服务器,请确保在 TLS 中断和检查中排除发往“https://device.login.microsoftonline.com”的流量。 未能排除“https://device.login.microsoftonline.com”可能会导致干扰客户端证书身份验证,从而导致设备注册和基于设备的条件访问出现问题。
如果组织计划使用无缝 SSO,则必须可从组织内的计算机访问以下 URL, 并且还必须将该 URL 添加到用户的本地 Intranet 区域。
https://autologon.microsoftazuread-sso.com
此外,应在用户的 Intranet 区域中启用以下设置:“允许通过脚本更新状态栏”。
如果组织对本地 Active Directory 使用托管(非联合)设置并且不使用 Active Directory 联合身份验证服务 (AD FS) 与 Azure AD 联合,则 Windows 10 上的混合 Azure AD 加入依赖于 Active Directory 中要同步到 Azure AD 的计算机对象。 确保包含需要加入混合 Azure AD 的计算机对象的任何 OU 都启用了 Azure AD Connect 同步配置中的同步。
对于 Windows 10 设备(1703 或更早版本),如果组织需要通过出站代理访问 Internet,则必须实现 Web 代理自动发现 (WPAD),使 Windows 10 计算机可以注册到 Azure AD。
从 Windows 10 1803 开始,即使由联合域中的设备通过 AD FS 进行的混合 Azure AD 加入尝试失败,在 Azure AD Connect 已配置为将计算机/设备对象同步到 Azure AD 的情况下,设备也会尝试使用同步的计算机/设备完成混合 Azure AD 加入操作。
若要验证设备是否能够访问系统帐户下的上述 Microsoft 资源,可以使用测试设备注册连接脚本。
验证配置步骤
可以为各种类型的 Windows 设备平台配置联接到混合 Azure AD 的设备。 本主题包含所有典型配置方案所需的步骤。
在下表中了解方案所需的步骤概述:
| 步骤 | Windows 当前设备与密码哈希同步 | Windows 当前设备与联合 | Windows 下层设备 |
|---|---|---|---|
| 配置服务连接点 | 勾选标记 | 勾选标记 | 勾选标记 |
| 设置声明颁发 | 勾选标记 | 勾选标记 | |
| 启用非 Windows 10 设备 | 勾选标记 | ||
| 验证联接的设备 | 勾选标记 | 勾选标记 | 勾选标记 |
配置服务连接点
在注册过程中,设备使用服务连接点 (SCP) 对象来发现 Azure AD 租户信息。 在本地 Active Directory 实例中,计算机林的配置命名上下文分区中必须存在用于加入混合 Azure AD 的设备的 SCP 对象。 每个林只有一个配置命名上下文。 在多林 Active Directory 配置中,服务连接点必须存在于所有包含已加入域的计算机的林中。
可以使用 Get-ADRootDSE cmdlet 来检索林的配置命名上下文。
对于具有 Active Directory 域名 fabrikam.com 的林,配置命名上下文是:
CN=Configuration,DC=fabrikam,DC=com
在林中,用于自动注册已加入域的设备的 SCP 对象位于:
CN=62a0ff2e-97b9-4513-943f-0d221bd30080,CN=Device Registration Configuration,CN=Services,[Your Configuration Naming Context]
SCP 对象可能已进行配置,具体取决于 Azure AD Connect 的部署方式。 可使用以下 Windows PowerShell 脚本验证该对象是否存在并检索发现值:
$scp = New-Object System.DirectoryServices.DirectoryEntry;
$scp.Path = "LDAP://CN=62a0ff2e-97b9-4513-943f-0d221bd30080,CN=Device Registration Configuration,CN=Services,CN=Configuration,DC=fabrikam,DC=com";
$scp.Keywords;
$scp.Keywords 输出显示 Azure AD 租户信息。 下面是一个示例:
azureADName:microsoft.com
azureADId:72f988bf-86f1-41af-91ab-2d7cd011db47
如果该服务连接点不存在,可在 Azure AD Connect 服务器上运行 Initialize-ADSyncDomainJoinedComputerSync cmdlet 来创建它: 必须有企业管理员凭据,才能运行此 cmdlet。
cmdlet:
- 在 Azure AD Connect 连接到的 Active Directory 林中创建服务连接点。
- 要求指定
AdConnectorAccount参数。 此帐户在 Azure AD Connect 中配置为 Active Directory 连接器帐户。
以下脚本演示了该 cmdlet 的用法示例。 在此脚本中,$aadAdminCred = Get-Credential 要求键入用户名。 需要以用户主体名称 (UPN) 格式 (user@example.com) 提供用户名。
Import-Module -Name "C:\Program Files\Microsoft Azure Active Directory Connect\AdPrep\AdSyncPrep.psm1";
$aadAdminCred = Get-Credential;
Initialize-ADSyncDomainJoinedComputerSync –AdConnectorAccount [connector account name] -AzureADCredentials $aadAdminCred;
Initialize-ADSyncDomainJoinedComputerSync cmdlet:
- 使用 Active Directory PowerShell 模块和 Azure Active Directory 域服务 (Azure AD DS) 工具。 这些工具依赖于在域控制器上运行的 Active Directory Web 服务。 运行 Windows Server 2008 R2 和更高版本的域控制器支持 Active Directory Web 服务。
- 仅受 MSOnline PowerShell 模块 1.1.166.0 版支持。 若要下载此模块,请使用此链接。
- 如果未安装 AD DS 工具,
Initialize-ADSyncDomainJoinedComputerSync会失败。 可以通过服务器管理器(在“功能” > “远程服务器管理工具” > “角色管理工具”下)安装 AD DS 工具。
对于运行 Windows Server 2008 或更低版本的域控制器,请使用以下脚本来创建服务连接点。 在多林配置中,请使用以下脚本在计算机所在的每个林中创建服务连接点。
$verifiedDomain = "contoso.com" # Replace this with any of your verified domain names in Azure AD
$tenantID = "72f988bf-86f1-41af-91ab-2d7cd011db47" # Replace this with you tenant ID
$configNC = "CN=Configuration,DC=corp,DC=contoso,DC=com" # Replace this with your Active Directory configuration naming context
$de = New-Object System.DirectoryServices.DirectoryEntry
$de.Path = "LDAP://CN=Services," + $configNC
$deDRC = $de.Children.Add("CN=Device Registration Configuration", "container")
$deDRC.CommitChanges()
$deSCP = $deDRC.Children.Add("CN=62a0ff2e-97b9-4513-943f-0d221bd30080", "serviceConnectionPoint")
$deSCP.Properties["keywords"].Add("azureADName:" + $verifiedDomain)
$deSCP.Properties["keywords"].Add("azureADId:" + $tenantID)
$deSCP.CommitChanges()
在前面的脚本中,$verifiedDomain = "contoso.com" 为占位符。 将它替换为 Azure AD 中的已验证域名之一。 需要先拥有域,然后才能使用它。
若要详细了解验证域名,请参阅将自定义域名添加到 Azure Active Directory。
若要获取已验证的公司域的列表,可以使用 Get-AzureADDomain cmdlet。
公司域的列表
设置声明颁发
在联合 Azure AD 配置中,设备依赖 AD FS 或 Microsoft 合作伙伴的本地联合身份验证服务向 Azure AD 进行身份验证。 设备将执行身份验证,以获取一个访问令牌来针对 Azure Active Directory 设备注册服务 (Azure DRS) 注册。
Windows 当前设备使用 Windows 集成身份验证向本地联合身份验证服务托管的 WS-Trust 活动终结点(版本 1.3 或 2005)进行身份验证。
使用 AD FS 时,需要启用以下 WS-Trust 终结点
/adfs/services/trust/2005/windowstransport/adfs/services/trust/13/windowstransport/adfs/services/trust/2005/usernamemixed/adfs/services/trust/13/usernamemixed/adfs/services/trust/2005/certificatemixed/adfs/services/trust/13/certificatemixed
Warning: adfs/services/trust/2005/windowstransport 和 adfs/services/trust/13/windowstransport 应仅作为面向 Intranet 的终结点启用,不能通过 Web 应用程序代理作为面向 Extranet 的终结点公开。 若要详细了解如何禁用 WS-Trust Windows 终结点,请参阅在代理上禁用 WS-Trust Windows 终结点。 可以通过 AD FS 管理控制台中的“服务” > “终结点”查看已启用哪些终结点。
Note: 如果不使用 AD FS 作为本地联合身份验证服务,请按供应商的说明操作,确保供应商支持 WS-Trust 1.3 或 2005 终结点,并且已通过元数据交换文件 (MEX) 发布这些终结点。
若要完成设备注册,Azure DRS 收到的令牌中必须存在以下声明。 Azure DRS 会根据该信息的部分内容在 Azure AD 中创建设备对象。 然后,Azure AD Connect 使用该信息将新建的设备对象与本地计算机帐户相关联。
http://schemas.microsoft.com/ws/2012/01/accounttypehttp://schemas.microsoft.com/identity/claims/onpremobjectguidhttp://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid
如果有多个已验证的域名,需要提供计算机的以下声明:
http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid
如果已颁发 ImmutableID 声明(例如,使用 mS-DS-ConsistencyGuid 或其他属性作为 ImmutableID 的源值),则需要提供计算机的一个对应声明:
http://schemas.microsoft.com/LiveID/Federation/2008/05/ImmutableID
以下部分介绍:
- 每个声明应使用的值。
- AD FS 中的定义形式。
定义可以帮助验证值是否存在,或者是否需要创建值。
Note: 如果不对本地联合身份验证服务器使用 AD FS,请遵照供应商的说明创建相应的配置来颁发这些声明。
颁发帐户类型声明
http://schemas.microsoft.com/ws/2012/01/accounttype 声明必须包含值 DJ,用于将设备标识为已加入域的计算机。 在 AD FS 中,可以添加如下所示的颁发转换规则:
@RuleName = "Issue account type for domain-joined computers"
c:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(
Type = "http://schemas.microsoft.com/ws/2012/01/accounttype",
Value = "DJ"
);
颁发本地计算机帐户的 objectGUID
http://schemas.microsoft.com/identity/claims/onpremobjectguid 声明必须包含本地计算机帐户的 objectGUID 值。 在 AD FS 中,可以添加如下所示的颁发转换规则:
@RuleName = "Issue object GUID for domain-joined computers"
c1:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
&&
c2:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(
store = "Active Directory",
types = ("http://schemas.microsoft.com/identity/claims/onpremobjectguid"),
query = ";objectguid;{0}",
param = c2.Value
);
颁发本地计算机帐户的 objectSID
http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid 声明必须包含本地计算机帐户的 objectSid 值。 在 AD FS 中,可以添加如下所示的颁发转换规则:
@RuleName = "Issue objectSID for domain-joined computers"
c1:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
&&
c2:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(claim = c2);
当 Azure AD 中存在多个已验证域名时颁发计算机的 issuerID
http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid 声明必须包含与颁发令牌的本地联合身份验证服务(AD FS 或合作伙伴)相连接的任何已验证域名的统一资源标识符 (URI)。 在 AD FS 中,可以在上述规则的后面,按特定的顺序添加如下所示的颁发转换规则。 注意,必须创建一条规则来显式为用户颁发规则。 在下面的规则中,添加的第一个规则用于标识用户而不是计算机身份验证。
@RuleName = "Issue account type with the value User when its not a computer"
NOT EXISTS(
[
Type == "http://schemas.microsoft.com/ws/2012/01/accounttype",
Value == "DJ"
]
)
=> add(
Type = "http://schemas.microsoft.com/ws/2012/01/accounttype",
Value = "User"
);
@RuleName = "Capture UPN when AccountType is User and issue the IssuerID"
c1:[
Type == "http://schemas.xmlsoap.org/claims/UPN"
]
&&
c2:[
Type == "http://schemas.microsoft.com/ws/2012/01/accounttype",
Value == "User"
]
=> issue(
Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid",
Value = regexreplace(
c1.Value,
".+@(?<domain>.+)",
"http://${domain}/adfs/services/trust/"
)
);
@RuleName = "Issue issuerID for domain-joined computers"
c:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(
Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid",
Value = "http://<verified-domain-name>/adfs/services/trust/"
);
在前面的声明中,<verified-domain-name> 为占位符。 将它替换为 Azure AD 中的已验证域名之一。 例如,使用 Value = "http://contoso.com/adfs/services/trust/"。
若要详细了解验证域名,请参阅将自定义域名添加到 Azure Active Directory。
若要获取已验证的公司域的列表,可以使用 Get-MsolDomain cmdlet。
公司域的列表
当用户存在一个 ImmutableID 时颁发计算机的 ImmutableID(例如,使用 mS-DS-ConsistencyGuid 作为 ImmutableID 的源)
http://schemas.microsoft.com/LiveID/Federation/2008/05/ImmutableID 声明必须包含计算机的有效值。 在 AD FS 中,可按如下所示创建颁发转换规则:
@RuleName = "Issue ImmutableID for computers"
c1:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
&&
c2:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(
store = "Active Directory",
types = ("http://schemas.microsoft.com/LiveID/Federation/2008/05/ImmutableID"),
query = ";objectguid;{0}",
param = c2.Value
);
用于创建 AD FS 颁发转换规则的帮助器脚本
可以借助以下脚本创建前述颁发转换规则。
$multipleVerifiedDomainNames = $false
$immutableIDAlreadyIssuedforUsers = $false
$oneOfVerifiedDomainNames = 'example.com' # Replace example.com with one of your verified domains
$rule1 = '@RuleName = "Issue account type for domain-joined computers"
c:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(
Type = "http://schemas.microsoft.com/ws/2012/01/accounttype",
Value = "DJ"
);'
$rule2 = '@RuleName = "Issue object GUID for domain-joined computers"
c1:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
&&
c2:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(
store = "Active Directory",
types = ("http://schemas.microsoft.com/identity/claims/onpremobjectguid"),
query = ";objectguid;{0}",
param = c2.Value
);'
$rule3 = '@RuleName = "Issue objectSID for domain-joined computers"
c1:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
&&
c2:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(claim = c2);'
$rule4 = ''
if ($multipleVerifiedDomainNames -eq $true) {
$rule4 = '@RuleName = "Issue account type with the value User when it is not a computer"
NOT EXISTS(
[
Type == "http://schemas.microsoft.com/ws/2012/01/accounttype",
Value == "DJ"
]
)
=> add(
Type = "http://schemas.microsoft.com/ws/2012/01/accounttype",
Value = "User"
);
@RuleName = "Capture UPN when AccountType is User and issue the IssuerID"
c1:[
Type == "http://schemas.xmlsoap.org/claims/UPN"
]
&&
c2:[
Type == "http://schemas.microsoft.com/ws/2012/01/accounttype",
Value == "User"
]
=> issue(
Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid",
Value = regexreplace(
c1.Value,
".+@(?<domain>.+)",
"http://${domain}/adfs/services/trust/"
)
);
@RuleName = "Issue issuerID for domain-joined computers"
c:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(
Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid",
Value = "http://' + $oneOfVerifiedDomainNames + '/adfs/services/trust/"
);'
}
$rule5 = ''
if ($immutableIDAlreadyIssuedforUsers -eq $true) {
$rule5 = '@RuleName = "Issue ImmutableID for computers"
c1:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid",
Value =~ "-515$",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
&&
c2:[
Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname",
Issuer =~ "^(AD AUTHORITY|SELF AUTHORITY|LOCAL AUTHORITY)$"
]
=> issue(
store = "Active Directory",
types = ("http://schemas.microsoft.com/LiveID/Federation/2008/05/ImmutableID"),
query = ";objectguid;{0}",
param = c2.Value
);'
}
$existingRules = (Get-ADFSRelyingPartyTrust -Identifier urn:federation:MicrosoftOnline).IssuanceTransformRules
$updatedRules = $existingRules + $rule1 + $rule2 + $rule3 + $rule4 + $rule5
$crSet = New-ADFSClaimRuleSet -ClaimRule $updatedRules
Set-AdfsRelyingPartyTrust -TargetIdentifier urn:federation:MicrosoftOnline -IssuanceTransformRules $crSet.ClaimRulesString
备注
-
此脚本将规则追加到现有规则。 请不要运行该脚本两次,否则会添加规则集两次。 再次运行该脚本之前,请确保这些声明没有相应的规则(在相应的条件下)。
-
如果有多个已验证的域名(可通过 Azure AD 门户或 Get-MsolDomain cmdlet 查看),请在脚本中将 $multipleVerifiedDomainNames 的值设置为 $true。 此外,请确保删除那些可能是通过 Azure AD Connect 创建的或通过其他方式创建的所有现有的 issuerid 声明。 下面是此规则的一个示例:
c:[Type == "http://schemas.xmlsoap.org/claims/UPN"] => issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/issuerid", Value = regexreplace(c.Value, ".+@(?<domain>.+)", "http://${domain}/adfs/services/trust/"));
如果已颁发用户帐户的 ImmutableID 声明,请在脚本中将 $immutableIDAlreadyIssuedforUsers 的值设置为 $true。
启用 Windows 下层设备
如果某些已加入域的设备是 Windows 下层设备,则需要:
- 在 Azure AD 中设置策略,使用户能够注册设备。
- 配置本地联合身份验证服务,通过颁发声明来支持使用 Windows 集成身份验证 (IWA) 进行设备注册。
- 将 Azure AD 设备身份验证终结点添加到本地 Intranet 区域,避免对设备进行身份验证时出现证书提示。
- 控制 Windows 下层设备
在 Azure AD 中设置策略,让用户能够注册设备
若要注册 Windows 下层设备,请确保已启用设置,允许用户在 Azure AD 中注册设备。 在 Azure 门户中,可以在“Azure Active Directory” > “用户和组” > “设备设置”下找到此设置。
以下策略必须设置为 All:用户可以向 Azure AD 注册其设备。
允许用户注册设备的“全部”按钮
配置本地联合身份验证服务
接收发往 Azure AD 信赖方的身份验证请求时,本地联合身份验证服务必须支持颁发 authenticationmehod 和 wiaormultiauthn 声明,其中包含具有以下编码值的 resource_params 参数:
eyJQcm9wZXJ0aWVzIjpbeyJLZXkiOiJhY3IiLCJWYWx1ZSI6IndpYW9ybXVsdGlhdXRobiJ9XX0
which decoded is {"Properties":[{"Key":"acr","Value":"wiaormultiauthn"}]}
此类请求传入时,本地联合身份验证服务必须使用 Windows 集成身份验证对用户进行身份验证。 身份验证成功后,联合身份验证服务必须颁发以下两个声明:
http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/windows http://schemas.microsoft.com/claims/wiaormultiauthn
在 AD FS 中,必须添加一个用于传递身份验证方法的颁发转换规则。 若要添加此规则,请执行以下操作:
-
在 AD FS 管理控制台中,转到“AD FS” > “信任关系” > “信赖方信任”。
-
右键单击“Microsoft Office 365 标识平台”信赖方信任对象,并选择“编辑声明规则”。
-
在“颁发转换规则”选项卡中,选择“添加规则”。
-
在“声明规则”模板列表中选择“使用自定义规则发送声明”。
-
选择“下一页”。
-
在“声明规则名称”框中,输入“身份验证方法声明规则”。
-
在“声明规则”框中,输入以下规则:
c:[Type == "http://schemas.microsoft.com/claims/authnmethodsreferences"] => issue(claim = c); -
在联合身份验证服务器上,输入以下 PowerShell 命令。 将 <RPObjectName> 替换为 Azure AD 信赖方信任对象的信赖方对象名称。 此对象通常命名为“Microsoft Office 365 标识平台”。
Set-AdfsRelyingPartyTrust -TargetName <RPObjectName> -AllowedAuthenticationClassReferences wiaormultiauthn
将 Azure AD 设备身份验证终结点添加到本地 Intranet 区域
为了避免已注册设备的用户在向 Azure AD 进行身份验证时出现证书提示,可将一个策略推送到已加入域的设备,以便在 Internet Explorer 中将以下 URL 添加到本地 Intranet 区域:
https://device.login.microsoftonline.com
控制 Windows 下层设备
若要注册 Windows 下层设备,需要通过下载中心下载并安装 Windows Installer 包 (.msi)。 有关详细信息,请参阅以受控方式验证 Windows 下层设备上的混合 Azure AD 加入部分。
验证联接的设备
可通过以下三种方法查找和验证设备状态:
在设备本地
- 打开 Windows PowerShell。
- 输入
dsregcmd /status。 - 确保“AzureAdJoined”和“DomainJoined”均设置为“是”。
- 可以使用 DeviceId,并使用 Azure 门户或 PowerShell 比较服务的状态。
使用 Azure 门户
- 使用直接链接进入设备页面。
- 有关如何查找设备的信息,请参阅如何使用 Azure 门户管理设备标识。
- 如果“已注册”列显示“挂起”,则表明混合 Azure AD 联接尚未完成。 在联合环境中,只有当注册失败并且 AAD Connect 配置为同步设备时,才会发生这种情况。
- 如果“已注册”列包含日期/时间,则表明混合 Azure AD 联接已完成。
使用 PowerShell
使用 Get-MsolDevice 验证 Azure 租户中的设备注册状态。 Azure Active Directory PowerShell 模块中包含此 cmdlet。
使用 Get-MSolDevice cmdlet 检查服务详细信息时:
- 必须存在其 设备 ID 与 Windows 客户端上的 ID 相匹配的对象。
- DeviceTrustType 的值为 Domain Joined。 此设置相当于 Azure AD 门户中“设备”页上的“已加入混合 Azure AD”状态 。
- 对于条件访问中使用的设备,Enabled 的值为 True,DeviceTrustLevel 的值为 Managed。
- 以管理员身份打开 Windows PowerShell。
- 输入
Connect-MsolService以连接到 Azure 租户。
统计所有已加入混合 Azure AD 的设备(不包括“挂起”状态)
(Get-MsolDevice -All -IncludeSystemManagedDevices | where {($_.DeviceTrustType -eq 'Domain Joined') -and (([string]($_.AlternativeSecurityIds)).StartsWith("X509:"))}).count
统计所有已加入混合 Azure AD 并处于“挂起”状态的设备
(Get-MsolDevice -All -IncludeSystemManagedDevices | where {($_.DeviceTrustType -eq 'Domain Joined') -and (-not([string]($_.AlternativeSecurityIds)).StartsWith("X509:"))}).count
列出所有已加入混合 Azure AD 的设备
Get-MsolDevice -All -IncludeSystemManagedDevices | where {($_.DeviceTrustType -eq 'Domain Joined') -and (([string]($_.AlternativeSecurityIds)).StartsWith("X509:"))}
列出所有已加入混合 Azure AD 并处于“挂起”状态的设备
Get-MsolDevice -All -IncludeSystemManagedDevices | where {($_.DeviceTrustType -eq 'Domain Joined') -and (-not([string]($_.AlternativeSecurityIds)).StartsWith("X509:"))}
列出单个设备的详细信息:
- 输入
get-msoldevice -deviceId <deviceId>(这是在设备本地获取的 DeviceId)。 - 确认“已启用”设置为 True 。
对实现进行故障排除
如果在对已加入域的 Windows 设备完成混合 Azure AD 加入时遇到问题,请参阅:
后续步骤
历史资料。此文对应 2022-08-12 的中文文档快照,适用产品版本和命令行为以原文为准。
来源与署名:Microsoft 和文档贡献者(原始作者元数据 MicrosoftGuyJFlo)。固定版本原文。文档采用 CC BY 4.0,示例代码采用 MIT 授权。本站将 Markdown 转为 HTML,规范化链接,移除外部媒体、发布器占位标签和导航标记。
