The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
Hi Stefan Falk
Based on my observation, this behavior is usually caused by a hidden or leftover (“ghost”) configuration in Exchange called the Federated Organization Identifier.
Even if you run Get-FederatedDomain and see nothing, Exchange may still have an old reference to a domain (like federated.yourdomain.com) stored in the background. Because the federation certificate has expired, Exchange can’t properly communicate with the Microsoft Federation Gateway to clean this up. That’s why commands to remove it often fail with errors like “Still in use” or connection issues.
Given this, you can try the below approach to see if it can help you:
Step 1: Clear the hidden configuration
Remove-FederatedOrganizationIdentifier -Confirm:$false
This removes the leftover domain reference that’s blocking everything.
Step 2: Remove the old federation trust, after step 1 succeeds, run
Remove-FederationTrust "Microsoft Federation Gateway"
Create a new certificate and generate a new self-signed certificate for federation.
Step 3: Recreate the federation trust
New-FederationTrust
Set-FederatedOrganizationIdentifier
You can try the above approach and get back to me with the results, if the issue still persists, kindly let me know in the comment section.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.