RM Logo
Technical Rating: 
Support Home PageSupport
Print This PagePrint This Page
Add to 'My Library' Add to 'My Library'

How to remove owners from Microsoft 365 groups in bulk using Windows PowerShell
Published Date : 30 Jun 2017   Last Updated : 04 Oct 2024   Content Ref: TEC5738129  





Symptoms

You have created large numbers of Microsoft® 365™ groups, possibly by enabling the RM Unify Microsoft 365 group sync functionality; extracting groups data from your MIS into RM Unify and then provisioning on to Microsoft 365. You wish to remove an owner, or owners, from all of these Microsoft 365 groups.



Requirements

You need Windows PowerShell® installed as per the following article: http://technet.microsoft.com/en-us/library/jj151815.aspx.

You also need the Microsoft 365 global administrator credentials.



Procedure

  1. On a computer with an Internet connection, open PowerShell, type $UserCredential = Get-Credential and press Enter.
  2. Enter your Microsoft 365 global administrator credentials when prompted.
  3. Type the following and press Enter:
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
  4. Finally, type Import-PSSession $Session and press Enter. You are now connected to an Exchange Online PowerShell session.
  5. Type the following and press Enter:
    Get-UnifiedGroup | %{Remove-UnifiedGroupLinks -Identity $_.identity -LinkType Owners -Links <email address of the owner(s) to be removed> -Confirm:$false}
    where multiple owners are separated by a comma.


Possible Issues

You may see the following error:

"You can't remove the owner from this group because the person you're removing is currently the only owner. You need to promote another member to owner before you proceed."

Microsoft 365 groups always require at least one owner to be present. You will not be able to remove your desired owner(s) if they are the only owners of the group. You can add additional owners to Microsoft 365 groups synced via RM Unify by logging on as an administrator to https://launchpad.rmunify.com/ManagementConsole/GroupSyncSettings, ticking the box next to the required administrator and clicking Save. The owners will then be updated during the scheduled overnight sync from RM Unify to Microsoft 365.

Alternatively, by logging on to https://portal.office.com/adminportal/home#/groups as an Microsoft 365 global administrator, Microsoft 365 groups can be selected and additional owners added.



Other Useful Articles

RM Unify Group Sync for Microsoft 365 groups (TEC5285553)

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: ps, o365, m365, TEC5738129


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


Top Of PageTop of page