0

This is the reverse of How to Convert o365 Group to Security Group?

This is a security group NOT a distribution list in which case I would've done Upgrade distribution lists to Microsoft 365 Groups in Outlook

Or perhaps I just convert "the security group" to "mail-enabled security group" first then do the "upgrade" I would accept that as an answer too. Note this is Office 365 so I don't have Exchange installed locally otherwise I would just do this Mail-enable or mail-disable existing security groups.

How to mail-enable an existing Azure AD security group? tried to go through this intermediate step as well. Though the current answer indicates this is not possible.

I basically want to retain the object ID since some external systems (specifically Sonarqube) uses the Object ID of my security group but I want the members of Developers (which are basically Internal Developers and Contractors groups) to be converted so I can use them with Microsoft Teams.

Is it possible?

I also don't have a local AD so I cannot avail of AD Group and Distribution Group with O365

2 Answers 2

2

No can do unfortunately.

From Microsoft online documentation:

Group type. You can't change the type of group after it's been created. To change the Group type, you must delete the group and create a new one.

Reference: https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-groups-settings-azure-portal#to-edit-your-group-settings

1
0

If anyone is looking to convert a security group to a 365 group

open an admin PowerShell

  1. install-module azureadpreview
  2. connect-azuread
  3. Powershell script
#Type name of security group
$Group1 = "security group name"
#enter email alis without spaces or special car 
$mailname = "securitygroupname"
$group1ObjectID = Get-AzureADGroup -Filter "Displayname eq '$group1'" | Select objectid -ExpandProperty ObjectID 
#Create new Office 365 group
New-AzureADMSGroup -DisplayName $Group1 -MailNickname $mailname -GroupTypes "Unified" -MailEnabled $false -SecurityEnabled $True 
$group2 = Get-AzureADMSGroup -Filter "MailNickname eq '$mailname'" 
$membersGroup1 = Get-AzureADGroupMember -ObjectId $group1ObjectID -All $true
foreach($member in $membersGroup1)
{
    $currentuser = Get-AzureADUser -ObjectId $member.ObjectId | select objectid
    Add-AzureADGroupMember -ObjectId $group2.ID -RefObjectId $currentuser.objectid
}
#press enter
Get-AzureADGroupMember -ObjectId $group2.ID -All $true

credit MS support Donal Mooney

1
  • So to be clear. This script would create a new Microsoft 365 group and add the members from the existing group to the new group. It will not convert a group to a different type. So please be careful to find any places the existing group may be referenced - e.g. Conditional Access, Intune policies etc...
    – Shotty
    May 28, 2023 at 23:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .