Thursday 24 September 2015

AD FS 3.0 Configuring SSO for Multiple Domains/UPN Suffixes

Active Directory Federation Services 3.0 supports SSO for multiple domains by default. In previous versions of AD FS (2.0, and 2.1) a number of updates were required in order for it to support this. At one stage, if an organization required AD FS SSO for multiple domains they had to deploy multiple AD FS infrastructures to support this. 

If you are using Office 365 and currently have multiple UPN Suffixes in your organization, the way in which you convert your domain to a "federated" domain is slightly different than the way you would configure it with a single domain.

At a high level you must have the following configured to ensure you can use SSO with multiple domain names;

Additional UPN Suffixes defined under Active Directory Domains and Trusts
Additional Domains configured within Office 365

In my environment my primary domain is this is the FQDN my Active Directory domain uses. I am going to configure my ADFS/Office 365 to support SSO for and

You can add additional domains in Office 365 from the Dashboard then Add Domain.

Once additional UPN's are added to a domain, you can use a user accounts property box under the Account tab, which UPN suffix is the default for that account.

The following commands are required if you have already converted your primary domain to a federated domain and SSO is working for the primary domain only. What this does is, revert the primary domain to a non-federated domain which removes the Office 365 Relay Trust from the AD FS infrastructure. The commands then create the Relay Trust and convert the primary domain back to being federated. The -SupportMultipleDomain is the important switch here.
Set-MsolAdfsContext -Computer ""
Convert-MsolDomainToStandard -DomainName "" -SkipUserConversion $True
Set-MsolAdfsContext -Computer ""
Convert-MsolDomainToFederated -Domain "" -SupportMultipleDomain
Convert-MsolDomainToFederated -Domain "" -SupportMultipleDomain
Convert-MsolDomainToFederated -Domain "" -SupportMultipleDomain
Update-MsolFederatedDomain -Domain "" -SupportMultipleDomain
Update-MsolFederatedDomain -Domain "" -SupportMultipleDomain

If you have not yet configured your domain to be federated, you can skip the step Convert-MsolDomainToStandard.
You can check if everything has worked correctly by using the following command;
All of your domains should now be set to Federated.