Forum Discussion
Setting Unified Group properties via API
Philisophical question: If an issue is easily solved in a one-line PowerShell command, why would you even think about writing some code to do the same thing with the Microsoft Graph? Much as I like the Graph (see https://www.petri.com/exploring-office-365-graph-explorer), there is no point in recreating wheels, even if the new wheel is extra-sparkly.
TonyRedmond One reason is if you -- like me -- are developing hosted services for use in a client's tenant and must use graph API calls to accomplish tasks like this because your code does not run within the client's network.
- TonyRedmondJan 18, 2021MVP
doughorton That's fair and a good reason. Another good reason is when you must deal with hundreds or even thousands of groups as Graph-based code will be much faster to process these objects than PowerShell will ever be. My comment still holds true in many other cases when PowerShell can do a job without the need to write any Graph code.
- SteveCoxMar 30, 2022Brass ContributorHi There I know this is an old thread but I am trying to create a Unified Group using Certificate based Authentication, I tried using ExchangeOnlineManagement Module, but apparently this doesn't work when you to use New-UnifiedGroup using CBA (Known Issue) so I tried using the Microsoft.Graph.Group Module using CBA to create the Unified Group, this created the Group, but I need to be able to Set the Primary Email address as well and cannot see a way to set this in the Microsoft.Graph.Group.
Do you know if there is a way to Set this via MS.Graph ?- TonyRedmondMar 30, 2022MVP
If you set the MailNickname property when running New-MgGroup and the group is mail enabled, the MailNickname becomes the root of the primarySmtpAddress.
$Group=New-MgGroup -DisplayName "March 2023 Sales Operations Team" -GroupTypes Unified -MailNickName March.2023.Sales.Operations -MailEnabled:$True -SecurityEnabled:$False -Description "A group for Sales Operation management"
Get-unifiedgroup -Identity $Group.Id | fl primarysmtpaddress
PrimarySmtpAddress : Email address removed