As many of you already know you can customize your ADFS login page, a bit.

The default page looks like this and can be a bit anonymous for your company

image

 

So I will guide you thru some steps to customize your page with PowerShell scripting

First create a company logo with the size 260×35 pixels and 96 dpi and no greater than 10 KB, save it as logo.png

Second to change the illustration on the left you need a picture with the size 1420×1080 pixels and 96 dpi, and no greater than 200 KB, save it as illustration.png

To apply the pictures use these PowerShell commands

Import-Module ADFS
Set-AdfsWebTheme -TargetName default -Logo @{path="c:\temp\logo.png"}
Set-AdfsWebTheme -TargetName default -Illustration @{path="c:\temp\illustration.png"} 

To customize texts and error descriptions you will need to use the cmdlet Set-AdfsGlobalWebContent, like the Description text below the login form

Set-AdfsGlobalWebContent -SignInPageDescriptionText “This is a private domain.<br>Make sure you are <b>authorized</b>”

Other texts you can modify are

Set-AdfsGlobalWebContent –HomeLinkText
Set-AdfsGlobalWebContent -ErrorPageDescriptionText
Set-AdfsGlobalWebContent -ErrorPageGenericErrorMessage
Set-AdfsGlobalWebContent -ErrorPageAuthorizationErrorMessage
Set-AdfsGlobalWebContent –ErrorPageDeviceAuthenticationErrorMessage
Set-AdfsGlobalWebContent –HelpDeskLink
Set-AdfsGlobalWebContent –HelpDeskLinkText
Set-AdfsGlobalWebContent –HomeLink
Set-AdfsGlobalWebContent –HomeLinkText
Set-AdfsGlobalWebContent –PrivacyLink
Set-AdfsGlobalWebContent –PrivacyLinkText

There are some trickier parts that are possible to change as well. For example these changes

image

 

First export the default theme to your computer and create a new ADFS theme with these commands

Import-Module ADFS

Export-AdfsWebTheme -Name default -DirectoryPath c:\Temp\Theme\Custom

New-AdfsWebTheme -Name Custom -SourceName default

Now it’s time to do some scripting, I will not go into details regarding the scripting.

Open the script file you downloaded from “C:\temp\Theme\Custom\script\onload.js” in Notepad

 

Add this line at the bottom of the script to change the placeholder text in the username input box

document.forms[‘loginForm’].UserName.placeholder = ‘Charles@CustomizedDomainName.Net’;

Add these lines at the bottom of the script to add a text above the login form, this is an example from Microsoft that you can find futher down

// Sample code to change “Sign in with organizational account” string.

// Check whether the loginMessage element is present on this page.

var loginMessage = document.getElementById(‘loginMessage’);

if (loginMessage)

{

       // loginMessage element is present, modify its properties.

       loginMessage.innerHTML = ‘Your custom company description text’;

}

When you are done and saved your changes it is time to upload the changes to the new created theme we named Custom

Set-AdfsWebTheme -TargetName Custom -AdditionalFileResource @{Uri=’/adfs/portal/script/onload.js’;path=”c:\temp\Theme\Custom\script\onload.js”}

Now don’t forget to apply the changes to set the active theme with this command

Set-AdfsWebConfig -ActiveThemeName Custom

Use these commands to verify your settings

Get-AdfsWebConfig

Get-AdfsGlobalWebContent

It can look like this when you are done!

image

 

Happy customization!

 

Note this is not a complete guide to all possible customizations that you can do!

 

Source

https://technet.microsoft.com/en-us/library/dn280950.aspx

https://technet.microsoft.com/en-us/library/dn636121.aspx

Advertisements