AD FS 中自訂 Web 主題Custom Web Themes in AD FS

適用於:Windows Server 2016、Windows Server 2012 R2Applies To: Windows Server 2016, Windows Server 2012 R2

預設稱為「已推出的 out\ of-the-方塊的主題。The theme that is shipped out-of-the-box is called Default. 您可以匯出預設的主題,並使用它,以便您可以快速開始。You can export the default theme and use it so that you can start quickly. 您可以自訂的外觀及操作,包括配置修改著、匯入並套用這個新的主題,並可以使用的自訂的外觀及操作。You can customize the appearance and behavior, which includes the layout by modifying the .css file, import and apply this new theme, and then you can use the customized appearance and behavior. 使用著也可讓您輕鬆地使用您的網路設計工具。Using the .css file also makes it easier to work with your web designers.

下列 cmdlet 建立自訂 web 主題,請重複的預設網頁主題。The following cmdlet creates a custom web theme, which duplicates the default web theme.

New-AdfsWebTheme –Name custom –SourceName default

您可以修改著並使用新藉著設定的新網頁主題。You can modify the .css file and configure the new web theme by using the new .css file. 若要匯出 web 主題,請使用下列 cmdlet。To export a web theme, use the following cmdlet.

Export-AdfsWebTheme –Name default –DirectoryPath c:\theme  

若要將著套用到新的主題,使用下列 cmdlet。To apply the .css file to the new theme, use the following cmdlet.

Set-AdfsWebTheme –TargetName custom –StyleSheet @{path=”c:\NewTheme.css”}  

下列 cmdlet 會建立新的樣式自訂 web 主題。The following cmdlet creates a custom web theme from a new style sheet.

New-AdfsWebTheme –Name custom –StyleSheet @{path=”c:\NewTheme.css”} –RTLStyleSheetPath c:\NewRtlTheme.css

AD FS 来套用的自訂 web 主題,請使用下列 cmdlet。To apply the custom web theme to AD FS, use the following cmdlet.

Set-AdfsWebConfig -ActiveThemeName custom

若要新增 AD FS JavaScript,使用下列 cmdlet。To add JavaScript to AD FS, use the following cmdlet.

Set-AdfsWebTheme -TargetName custom -AdditionalFileResource @{Uri=’ /adfs/portal/script/onload.js’;path="D:\inetpub\adfsassets\script\onload.js"}  

其他參考資料Additional references

AD FS 使用者登入自訂AD FS User Sign-in Customization