根據預設,Windows Server 2012 R2 的 Active Directory 同盟服務 (AD FS) 中會啟用 Windows 整合式驗證 (WIA),以取得組織內部網路(內部網路)內發生之驗證要求,以供任何使用瀏覽器進行驗證的應用程式使用。
AD FS 2016 現在已改善預設設定,使得 Edge 瀏覽器可以執行 WIA,並且不會錯誤地將 Windows Phone 也包括在內。
=~Windows\s*NT.*Edg.*
上述表示您不再需要設定個別的 User-Agent 字串來支援常見的 Edge 瀏覽器情境,即使它們經常更新也一樣。
對於其他瀏覽器,請設定AD FS屬性 WiaSupportedUserAgents,以根據您使用的瀏覽器新增必要的值。 您可以使用下列程序。
檢視 WIASupportedUserAgent 設定
WIASupportedUserAgents 會定義支援 WIA 的使用者代理程式。 AD FS 會在瀏覽器或瀏覽器控制項中執行登入時,分析使用者代理程式字串。
您可以使用下列 PowerShell 範例來檢視目前的設定:
Get-AdfsProperties | select -ExpandProperty WiaSupportedUserAgents
變更 WIASupportedUserAgent 設定
根據預設,新安裝的 AD FS 會建立一組使用者代理字串的符合項。 不過,這些可能根據瀏覽器和裝置的變更而過期。 特別是,Windows 裝置的使用者代理程式字串很相似,但在其中的一些元素存在些許差異。 下列 Windows PowerShell 範例提供目前市場上支援無縫 WIA 之裝置集的最佳指引:
如果您在 Windows Server 2012 R2 或更早版本上擁有 AD FS:
Set-AdfsProperties -WIASupportedUserAgents @("MSIE 6.0", "MSIE 7.0; Windows NT", "MSIE 8.0", "MSIE 9.0", "MSIE 10.0; Windows NT 6", "Windows NT 6.3; Trident/7.0", "Windows NT 6.3; Win64; x64; Trident/7.0", "Windows NT 6.3; WOW64; Trident/7.0", "Windows NT 6.2; Trident/7.0", "Windows NT 6.2; Win64; x64; Trident/7.0", "Windows NT 6.2; WOW64; Trident/7.0", "Windows NT 6.1; Trident/7.0", "Windows NT 6.1; Win64; x64; Trident/7.0", "Windows NT 6.1; WOW64; Trident/7.0","Windows NT 10.0; WOW64; Trident/7.0","MSIPC", "Windows Rights Management Client", "Edg/","Edge/")
如果您在 Windows Server 2016 或更新版本上有 AD FS:
Set-AdfsProperties -WIASupportedUserAgents @("MSIE 6.0", "MSIE 7.0; Windows NT", "MSIE 8.0", "MSIE 9.0", "MSIE 10.0; Windows NT 6", "Windows NT 6.3; Trident/7.0", "Windows NT 6.3; Win64; x64; Trident/7.0", "Windows NT 6.3; WOW64; Trident/7.0", "Windows NT 6.2; Trident/7.0", "Windows NT 6.2; Win64; x64; Trident/7.0", "Windows NT 6.2; WOW64; Trident/7.0", "Windows NT 6.1; Trident/7.0", "Windows NT 6.1; Win64; x64; Trident/7.0", "Windows NT 6.1; WOW64; Trident/7.0","Windows NT 10.0; WOW64; Trident/7.0", "MSIPC", "Windows Rights Management Client", "=~Windows\s*NT.*Edg.*")
上述命令可確保AD FS只涵蓋下列 WIA 使用案例:
使用者代理程式 | 使用案例 |
---|---|
MSIE 6.0 | IE 6.0 |
MSIE 7.0;Windows NT | IE 7、內部網路區域中的 IE。 「Windows NT」片段是由桌面作業系統傳送的。 |
MSIE 8.0 | IE 8.0 (沒有裝置傳送這個資訊,因此需要更具體化) |
MSIE 9.0 | IE 9.0 (沒有裝置會發送這個,因此不需要更詳細說明) |
MSIE 10.0;Windows NT 6 | Windows 7 及更新版本的桌面作業系統用的 IE 10.0 ,Windows Phone 8.0 裝置(偏好設定為行動)則被排除,因為它們會傳送 使用者代理字串:Mozilla/5.0(compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920) |
Windows NT 6.3;Trident/7.0 Windows NT 6.3;Win64;x64;Trident/7.0 Windows NT 6.3;WOW64;Trident/7.0 |
Windows 8.1 桌面作系統,不同平臺 |
Windows NT 6.2; Trident/7.0 Windows NT 6.2; Win64; x64; Trident/7.0 Windows NT 6.2; WOW64; Trident/7.0 |
Windows 8 桌面作系統,不同平臺 |
Windows NT 6.1; Trident/7.0 Windows NT 6.1; Win64; x64; Trident/7.0 Windows NT 6.1; WOW64; Trident/7.0 |
Windows 7 桌面作系統,不同平臺 |
Edg/ 和 Edge/ | 適用於 Windows Server 2012 R2 或更早版本的 Microsoft Edge (Chromium) |
=~Windows\s*NT.*Edg.* | 適用於 Windows Server 2016 或更新版本的 Microsoft Edge (Chromium) |
MSIPC | Microsoft 信息保護與控制客戶端 |
Windows Rights Management 用戶端 | Windows Rights Management 用戶端 |