RM Home
Support
Sections
My Support Calls
Search Library
Drivers and Downloads
Guide to Support Online
FAQs
Events
Technical Rating: 
Support Home PageSupport
Print This PagePrint This Page
Add to 'My Library' Add to 'My Library'

Microsoft PowerShell script to unfederate a Microsoft 365 domain from RM Unify
Published Date : 02 Jan 2020   Last Updated : 01 Jun 2023   Content Ref: DWN7126758  





Description

Provides a Microsoft® PowerShell® script which will unfederate the Microsoft 365™ domain and clear the OnPremisesImmutableId property of all the users in the domain to facilitate direct sign in to Microsoft 365.

You are using this article in conjunction with the article TEC3229605, see Other Useful Articles section below.



Requirements

The computer must have:



Download Instructions

In Microsoft Edge:

  1. Right-click the disk icon and select 'Open link'.
  2. In the dialog box that appears, select 'Save as'. When the Save As window is displayed and prompts for a location to save the download to, browse to the folder where you want to save it and click Save.
  3. When the download has finished, click Close.
  4. Extract the file to a location of your choice.

In Google Chrome:

  1. Right-click the disk icon and select 'Save link as'.
  2. When the Save As window is displayed and prompts for a location to save the download to, browse to the folder where you want to save it and click Save.
  3. When the download has finished, click Close.
  4. Extract the file to a location of your choice.


Download

FilenameFile SizeDownload
unfederate_m365domain_from_rmunify.ps15 kb Download


Installation Instructions

  1. Please check that you have working credentials for a Microsoft 365 global administrator account, with a username on your initial 'onmicrosoft.com' domain, e.g. JSmith@SchoolA.onmicrosoft.com. 
    Important: You may inadvertently lock yourself out of your tenancy if you unfederate using a global administrator on your federated domain.
  2. Open a new PowerShell window and change the folder location to where you extracted the script file.
  3. Run the script file.
  4. When prompted, enter the Microsoft 365 domain name you wish to unfederate.
  5. When prompted, enter your Microsoft 365 global administrator credentials. If the details entered are correct, the script will unfederate your Microsoft 365 domain, and clear the Immutable IDs of all users in the domain.  For 1000 users, this will take approximately 20 minutes.
  6. Wait until the script runs to completion.
  7. Once completed, you will see the message:
    *******************************************************************************************************************
    Unfederation completed successfully.  No users on <domain> have an OnPremisesImmutableId.

    Please wait a further 60 minutes to allow Microsoft to fully process the domain conversion.
    Users will then be able to sign in to Microsoft 365 and Office after you have assigned a password to their Microsoft 365 user account.

    Please refer to Microsoft online support for further help on resetting user passwords and how users can sign in.
    *******************************************************************************************************************
  8. If your domain is already unfederated, you will get the message: "Domain <domain> is not federated. Do you still want to proceed with clearing user OnPremisesImmutableId? Please enter y/n."


Possible Issues

Script reports a failure to remove OnPremisesImmutableId

The script may fail to remove the OnPremisesImmutableId of a user, reporting that the affected account is a local account and not a cloud account.

This can occur when the domain is not fully federated to RM Unify at the time you ran the script and the affected M365 account was originally created in M365 by synchronisation with AD, e.g. previous use of Azure AD Connect. Microsoft may prevent removal of the OnPremisesImmutableId on M365 accounts it believes are still linked to your AD.

To successfully remove the OnPremisesImmutableId, you must convert the affected M365 account to a cloud account and re-run the script. There are multiple ways to do this depending on your own setup. Please refer to your network support provider or Microsoft for further advice.



FEEDBACK
Did the information in this article help answer your question?
 Yes
 No
Please add any comments about this article in the box below. If you answered No then it is important you tell us why so that we can change the article if required. We can only respond if you log in to the RM Support website or provide your contact details. Note: If you need help with a technical query, please log a call online or telephone our support team.
Thank you for your feedback, which is sent directly to the RM Knowledge team. We address every message received with the intention of improving our Knowledge Library articles. If you have an unresolved technical issue, please contact RM Support.


If this article has not helped provide a solution then it is also possible to log a call...



Document Keywords: PowerShell, powershell, unfederated, O365, PowerShell script, immutable ID, immutable id, id, ID, TEC3229605, unfederate Microsoft Office 365 domain, Microsoft Office 365 domain, rm unify, unify, M365, DWN7126758, immutableid, onpremisesid, onpremisesimmutableid, on-premisesid, on-premise, onpremise, on-premisesimmutableid


Please read - important disclaimer information.
http://www.rm.com/_RMVirtual/Includes/csredirect.asp?cref=&title=Standard Content Disclaimer


Top Of PageTop of page