Official Documentation: https://learn.microsoft.com/en-us/powershell/module/adfs
The ADFS module includes a range of cmdlets for managing ADFS services, including:
Summary: | Instructions on how to increase or decrease ADFS timeouts of relying parties for Microsoft Dynamics 365 / Dynamics CRM when Internet Facing Deployment (IFD) is set up and configured. |
Article Type: | Information / Troubleshooting / Support |
Related Product(s): | This article relates to the following products:
|
Related Articles: |
Currently, we have plenty of WS-FED and SAML applications managed by ADFS 4.0 (ADFS 2016).
For a some of the relying parties (service providers) we’ve set Custom Web Themes with Set-AdfsRelyingPartyWebTheme
as discribed here:
https://learn.microsoft.com/en-us/powershell/module/adfs/set-adfsrelyingpartywebtheme?view=windowsserver2016-ps
$RelyingPartyName = "MyRpName"
$WebThemeName = "MyCustomLoginTheme"
Set-AdfsRelyingPartyWebTheme -TargetRelyingPartyName $RelyingPartyName -SourceWebThemeName $WebThemeName
This is working without any problem.
We recently started to add OAuth applications (WebApiApplication
with a NativeClientApplication
) with ADFS using the Application Groups
functionality.
The login process is working without any problem.
What I am missing or could not find in the documentation is a powershell command such as
Set-AdfsNativeClientApplicationWebTheme
or at least Set-AdfsApplicationGroupWebTheme
I’ve also checked alternatives. Neither Set-AdfsNativeClientApplication
nor Set-AdfsApplicationGroup support a SourceWebThemeName
parameter.
You can use the same exact cmdlet to apply a webtheme to an app inside an application group, just use the application display name (not the identifier) as the -TargetRelyingPartyName parameter. Just be careful that in some cases you have to apply the custom webtheme to the web application or the webapi. It depends on how the authentication is triggered, generally speaking you have to assign the webtheme to the “resource” specified in the authorization request.
2 silver badges9 bronze badges
In this blog we will learn what are endpoints in ADFS, we will talk about ADFS endpoints configuration, we will discuss ADFS endpoints list, and how to manage ADFS endpoints with PowerShell.
Table of Contents
Watch video
Join us on our YouTube channel and learn what are endpoints in ADFS and how to manage endpoints using PowerShell commands.
What are endpoints in ADFS
But how ADFS server will identify that the request that it is getting, is coming from a web-based application or it is a rich-client application? And the answer is, ADFS identifies these requests with the help of endpoints.

When we install ADFS, few endpoints are created automatically. You can access the endpoint of your ADFS server either from ADFS Management Console or you can run Get-ADFSEndpoint in Windows PowerShell on ADFS server and this will list all the endpoints of your ADFS server.
These endpoints are responsible to receive certain types of requests. There are multiple endpoints in ADFS server, but we are going to talk about 2 important endpoints. ADFS/LS and TRUST/MEX.

Important: Both the endpoints are secured with HTTPS. That means any communication that is happening on this endpoint is secured. And these endpoints are secured with the Service Communication certificate of your ADFS server.
If you look at the below endpoint URL, you can see this URL is secured. in this URL you can see the Federation Service Name of the ADFS server (adfs.office365concepts.com). And next to the Federation Service Name you can see the endpoint name (/adfs/ls) which is responsible to receive certain requests.
ADFS Endpoints Configuration
ADFS endpoints list
To manage endpoints from ADFS server, go to Server Manager, go to Tools and click AD FS Management.
In AD FS Management console, expand Service and click Endpoints. This will list all the endpoints in your ADFS server.

Let’s discuss endpoints properties:
Enabled (Yes/No): If an endpoint is set to Yes under Enabled, that means this endpoint is active and is listening to the traffic. And if endpoint is set to No under Enabled, that means this endpoint is currently not enabled and it will not answer any request.
Proxy Enabled (Yes/No): This indicates that this endpoint is enabled on your ADFS proxy server.
URL Path: Under URL Path you can see complete URL of the endpoints.
Manage ADFS endpoints with PowerShell
To view all the endpoints in ADFS server, run below command in Windows PowerShell on ADFS server.
Get-AdfsEndpoint -FullUrl "https://adfs.office365concepts.com/adfs/ls/"
To enable an endpoint run below command:
Enable-ADFSEndpoint -TargetFullUrl "https://adfs.office365concepts.com/adfs/ls/"
After running above command, you need to restart ADFS service on the server. And if you have multiple ADFS servers in your farm, you need to restart this service on all the ADFS servers.
To disable ADFS endpoint, run below command in Windows PowerShell on ADFS server.
Disable-ADFSEndpoint -TargetFullUrl "https://adfs.office365concepts.com/adfs/ls/"
After running above command, you need to restart ADFS service on the server. And if you have multiple ADFS servers in your farm, you need to restart this service on all the ADFS servers.
If you want to enable an endpoint on Proxy Server, run below command in Windows PowerShell on ADFS server.
Set-ADFSEndpoint -Targetfullurl "https://adfs.office365concepts.com/adfs/ls/" -Proxy $true
Note: This endpoint must be enabled on the ADFS server before you enable it on Proxy Server.
If you to verify, that if ADFS endpoints are working and if they are able to receive requests from the applications, you can copy any endpoint, paste it in the browser, and you should see below xml response.

If you see above response, that means this endpoint is reachable and request can be reached to this particular endpoint.
Conclusion
So in nutshell, endpoints are the entry points for the applications those are responsible to process or to receive certain requests.
In this blog we learnt what are endpoints in ADFS, we learnt how to manage ADFS endpoints with PowerShell and how to list ADFS endpoints in ADFS Management console.
Related articles
We welcome you to browse our other articles on ADFS (Active Directory Federation Services):
What is ADFS
What is federation trust in ADFS
ADFS deployment types
How to install ADFS on Windows Server 2016
ADFS claims based architecture
Set up ADFS for Microsoft 365 for Single Sign-On
В качестве операционной системы я буду использовать Windows Server 2019. Эта версия операционной системы включает в себя Windows Server 2019 AD FS. В каждой версии AD FS Microsoft добавляет какие-то новые функции. Ознакомиться с перечнем последних изменений можно вот тут.
Особых предварительных требований перед установкой AD FS нет. Необходимо только, чтобы сервер, на котором вы планируете установить AD FS, был присоединен к доменеу Active Directory.
Непосредственно перед как будет запущена установка Active Directory Federation Services необходимо выполнить ряд подготовительных действий:
1. Сначала создадим центр распределения ключей (KDS) вручную, чтобы не ждать репликацию 10 часов. Запустите PowerShell от имени администратора и выполните следующую команду:
Add-KdsRootKey –EffectiveTime (Get-Date).AddHours(-10)
2. Также для установки нам понадобится SSL сертификат, т.к. AD FS принимает подключения на порту TCP/443. О том, как выпустить бесплатный сертификат я уже рассказывал. После выпуска установить сертификат в личное хранилище компьютера.
3. В процессе установки сервера AD FS необходимо будет определить имя, по которому сервер будет прослушивать подключения. Если это имя совпадает с текущем именем сервера, то дополнительных действий не требуется. Я определю имя sso.itproblog.ru, что не совпадает с текущем именем сервера. Соответственно, мне нужно будет зарегистрировать дополнительное имя в моем внутреннем сервере DNS:

Теперь я покажу, как выполняется eстановка Active Directory Federation Services:
1. Запустите Server Manager и выберите пункт “Add Roles and Features”:

2. На странице приветствия мастера установки и выбора типа установки нажмите кнопку “Next”.
3. На странице выбора сервера укажите ваш сервер AD FS и нажмите “Next”.

4. Теперь важный момент. На странице выбора ролей и компонентов необходимо указать роль “Active Directory Federation Services”.

5. На следующий страницах мастера установки достаточно нажать “Next”. На заключительном шаге нажмите “Install”. Дождитесь окончания процесса установки роли AD FS.
6. После завершения установки роли её необходимо настроить.

7. Нам необходимо создать новую ферму из одного сервера, т.к. в этой статье не рассматривается отказоустойчивая конфигурация AD FS:

8. Затем нам необходимо указать учетную запись администратора домена Active Directory, чтобы мастер настройки мог внести нужные изменения в AD:

9. На следующем шаге нужно выбрать SSL сертификат, который мы импортировали ранее, указать имя, по которому сервер AD FS будет доступен и выбрать отображаемое имя сервера.

10. AD FS поддерживает работу с групповыми управляемыми учетными записями (gMSA). Более того, он может создать такую запись за вас. Достаточно указать имя учетной записи.

11. Повторю – я не рассматриваю ферму AD FS серверов, т.е. выполняю настройку без отказоустойчивого сценария. И для этого сценария базы данных WID (Windows Internal Datase) более чем достаточно.

12. Заключительным шагом необходимо ознакомится со всей сводкой вносимых изменений, а затем инициировать процесс установки.

13. Дождитесь пока завершится установка Active Directory Federation Services.
Установку мы с вами выполнили. Теперь давайте проверим – все ли у нас получилось. Для этого есть несколько простых шагов.
1. Вы можете попробовать получить метаинформацию о сервере AD FS по специльному URL:
https://sso.itproblog.ru/adfs/fs/federationserverservice.asmx
В случае успешной установки сервера AD FS вы должны увидеть XML документ с описанием нашего сервера.

2. Еще один вариант – это использование специальной тестовой страницы для проверки SSO. Однако, предварительно эту страницу нужно включить. Выполните вот этот командлен в консоле PowerShell от имени администратора:
Set-AdfsProperties -EnableIdPInitiatedSignonPage $true
А теперь перейдите на страницу тестирования SSO:
https://sso.itproblog.ru//adfs/ls/idpinitiatedsignon

Нажмите кнопку “Sign in” и укажите ваши учетные данные.

В случае успешного завершения процедуры входа вы увидите соответствующую запись на тестовой страницы.

Пример сервиса сброса паролей
В качестве примера использования сервиса AD FS я покажу как можно настроить сервис смены паролей пользователей.
1. Сначала нужно включить этот сервер. Для этого запустите консоль управления сервиса AD FS и перейти в раздел “Endpoints”.

2. В списке найдите URL /adfs/portal/updatepassword и в контекстном меню выберите пункт “Enable”.

3. Консоль управления AD FS уведомит нас о том, что необходимо перезапустить сервис AD FS.

4. Запустить консоль PowerShell от имени администратора и перезапустите сервис AD FS:
Restart-Service adfssrv
5. Теперь вы можете перейти на страницу портале смены пароля пользователя:
https://sso.itproblog.ru/adfs/portal/updatepassword

Указав текущий и новый пароль для пользователя вы сможете инициировать процедуру смены пароля.
We use out of this module the following cmdlets
This page was generated automatically and may contain errors. It does not claim to be complete or correct. All information without guarantee.
Update the timeout using Microsoft PowerShell
To change the timeout value, you will need to update the TokenLifetime value. This is achieved using PowerShell. Before you open PowerShell, you will need to find the name of each Relying Party.
Step 1: Find out the name of the relying party
- Open AD FS Management
- Navigate to AD FS > Trust Relationships > Relying Party Trusts
- Make a note of the display name for each relying party
ADFS Relying Party List
Step 2: Update the TokenLifetime value
- Open Microsoft PowerShell as a user with administrator permissions
- Load the ADFS snap-in
Add-PSSnapin Microsoft.ADFS.PowerShell - Get the relying party trust settings for each relying party. Use the display name from the previous step.
get-ADFSRelyingPartyTrust -Name “CRM – Local”get-ADFSRelyingPartyTrust -Name “CRM – Local”
- Check the TokenLifetime value. This number represents minutes
- Set the TokenLifetime to the new value (8 hours = 480)
Set-ADFSRelyingPartyTrust -Targetname “CRM – Local” -TokenLifetime 480Set-ADFSRelyingPartyTrust -Targetname “CRM – Local” -TokenLifetime 480
- Repeat this step for each relying party
Related Information: |
Your session has expired
Your session has expired