Idira Identity: How to delete an "orphaned" synced account from Office 365

Idira Identity: How to delete an "orphaned" synced account from Office 365

88
Created On 11/10/26 10:59 AM - Last Modified 11/10/26 13:03 PM


Question


If a User is disabled, or deleted in source directory (typically Active Directory), but de-provisioning rules are not configured to delete the User from Office 365 when deleted or disabled from source directory, then the User object will be orphaned in Office 365.

Scenario 1:
Most common scenario to create this situation is:

1. User is disabled in source directory, prompting a de-provision event to remove the license in Office 365.
2. User is later deleted, but the de-provisioning rule to delete the user when deleted from source directory does not take effect. This is because, at this time, CyberArk Identity does not sync any changes for disabled Users, including delete events.

image.png


Scenario 2:
Another, less common scenario that this could occur in, is a failed migration, creating split mailboxes, and the mailbox or user needs to be deleted to re-provision correctly. This will manifest in such a way that the end User is constantly prompted with a popup in Outlook saying, "The Microsoft Exchange administrator has made a change that requires you to quit and restart Outlook".

image.png

In both cases: How can an Administrator delete the Federated user after this occurs?
 


Environment


Identity

Answer


The commands in this KB are found in the following Microsoft documentation, provided as a courtesy, and should only be used by an Administrator familiar with remote powershell with Azure Active Directory. 

Remove-MsolUser 
https://docs.microsoft.com/en-us/powershell/module/msonline/remove-msoluser?view=azureadps-1.0

Remove-MsolGroup
https://docs.microsoft.com/en-us/powershell/module/msonline/remove-msolgroup?view=azureadps-1.0


1. To remove the User, an Administrator should first connect to Azure Active Directory using remote powershell. Instructions can be found here, if needed (provided as a courtesy).
 https://technet.microsoft.com/library/dn975125.aspx

2a.  Next, an Administrator will need to run the following two commands. One to remove the user, and the next to flush from the recyclebin. 
  • Remove-MsolUser -UserPrincipalName <userprincipalname>
  • Remove-MsolUser -UserPrincipalName <userprincipalname> -RemoveFromRecycleBin 
       (Replace <UserPrincipalName> with the actual UPN, e.g. alias@tenant.onmicrosoft.com )

2b. The following command can be used to remove Office 365 Groups 
  • Get-MsolGroup -SearchString "GroupName" | Remove-MsolGroup


Additional Information


Details

Question:

If a User is disabled, or deleted in source directory (typically Active Directory), but de-provisioning rules are not configured to delete the User from Office 365 when deleted or disabled from source directory, then the User object will be orphaned in Office 365.
 
Scenario 1-
Most common scenario to create this situation is:

1. User is disabled in source directory, prompting a de-provision event to remove the license in Office 365.
2. User is later deleted, but the de-provisioning rule to delete the user when deleted from source directory does not take effect. This is because, at this time, CyberArk Identity does not sync any changes for disabled Users, including delete events.

Scenario 2-
Another, less common scenario that this could occur in, is a failed migration, creating split mailboxes, and the mailbox or user needs to be deleted to re-provision correctly. This will manifest in such a way that the end User is constantly prompted with a popup in Outlook saying, "The Microsoft Exchange administrator has made a change that requires you to quit and restart Outlook"



In both cases: How can an Administrator delete the Federated user after this occurs?



Answer:

The commands in this KB are found in the following Microsoft documentation, provided as a courtesy, and should only be used by an Administrator familiar with remote powershell with Azure Active Directory. 

Remove-MsolUser 
https://docs.microsoft.com/en-us/powershell/module/msonline/remove-msoluser?view=azureadps-1.0

Remove-MsolGroup
https://docs.microsoft.com/en-us/powershell/module/msonline/remove-msolgroup?view=azureadps-1.0


1. To remove the User, an Administrator should first connect to Azure Active Directory using remote powershell. Instructions can be found here, if needed (provided as a courtesy).
 
https://technet.microsoft.com/library/dn975125.aspx

2a.  Next, an Administrator will need to run the following two commands. One to remove the user, and the next to flush from the recyclebin. 
  • <userprincipalname> Remove-MsolUser -UserPrincipalName
  • Remove-MsolUser -UserPrincipalName <userprincipalname> -RemoveFromRecycleBin 
       (Replace <UserPrincipalName> with the actual UPN, e.g. alias@tenant.onmicrosoft.com )


2b. The following command can be used to remove Office 365 Groups 
  • Get-MsolGroup -SearchString "GroupName" | Remove-MsolGroup



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj00000014KzCAI&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail