Setting Unified Group properties via API

Brass Contributor

The Set-UnifiedGroup PowerShell commandlet has a couple of interessting properties. In particular, hiding the group from the global address list (HiddenFromAddressListsEnabled) and enabling/disabling the welcome e-mail (UnifiedGroupWelcomeMessageEnabled).

 

Is there a way to set these properties either as default for the entire O365 tenant or via the Graph API on a per group basis?

 

Background info:

I am looking for a way to do this without PowerShell, on purpose, because I am working on a provisioning solution coded in C# (and not PowerShell). All provisioning actions should run in the same thread...

30 Replies

Get-UnifiedGroup | Set-UnifiedGroup -HiddenFromAddressListsEnabled $True...

Dear Berend

 

Yes is looks like you can use the Graph API to update these as well.  That is pretty cool.

 

You have to find the directory template object for "Unified groups" using the API  and then reference that template when updating the particular group.

 

 (https://graph.microsoft.com/beta/directorySettingTemplates)

 

Love the Microsoft graph.  Sounds like another addin that we can create that would make it easier to update these settings.  Let's collaborate if you like.  You can schedule a quick online meeting with me using our bookings site  Use the option for the free "Products questions and answers" session.  If not I will let you know after we create the addin.

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. 

Thanks for your response. Interessting with the directorySettingTemplates. Unfortunately it looks like it does not solve my problem, because the template does not expose the welcome mail and GAL settings.

Sorry, but I need a C# solution. PowerShell will not do in my case - I have added a bit background info to the question.

Fair enough, PowerShell can't do everything...

Dear Tony

I am starting to appreciate that these easy to use buttons apps (inside the office ribbon) are sometimes a better way to "fill in" the features in Office 365 and Azure.

 

Groups is an interesting object.  You can provide certain capabilities to "Owners" of the Group that don't require an IT or Powershell type of solution.  In many cases the Group Owner or Member can be an Outlook user who doesn't have or need Powershell.  Eventually Microsoft will catch up the UI elements in Groups as they have been doing in Office 365.  For now, we can fill in with addins to the UI for some of those missing elements.

 

We create many custom addins for customers making the move to Office 365 and Azure and each one seems to make the transition easier, faster and better.  Change is always hard and ease of use or the familiarity of the Office apps can increase adoption and in some cases, remove the barrier for making the move.

 

MS Graph give us a standard way to create or update most objects throughout all the services making it efficient and affordable to do the apps for customers even in a simple example like this one.  The value can be in the Outlook user maintaining the setting rather than an IT request.

Dear Bernd

I see that now.  Those settings are on the mailbox in exchange rather than the Group.  I put together a quick app with a button on the Groups ribbon "update settings". That pops a Custom task pane in Outlook with a simple update on the mailbox settings for that group.  Is that what you are looking for?Let me know more details and as I said we can work together. book a meeting

 

Settings update.png

Hi Don,

 

Thanks for your reply. I would be interested in how you get/set these values on the exchange mailbox. I cannot see the attributes exposed in either Exchange REST nor Microsoft Graph API.

 

I am looking for an automated way to this. So, an Outlook add-in does not solve my issue...

Hey Don,

 

Would you be kind to share a key part of the code to suppress welcome email ?


@Don DeCarlo wrote:

Dear Berend

 

Yes is looks like you can use the Graph API to update these as well.  That is pretty cool.

 

You have to find the directory template object for "Unified groups" using the API  and then reference that template when updating the particular group.

 

 (https://graph.microsoft.com/beta/directorySettingTemplates)

 

Love the Microsoft graph.  Sounds like another addin that we can create that would make it easier to update these settings.  Let's collaborate if you like.  You can schedule a quick online meeting with me using our bookings site  Use the option for the free "Products questions and answers" session.  If not I will let you know after we create the addin.



The API reference doesn't say which key needs to be off. I may have missed it as I am not very familiar with MS group underneath.

 

Anyone found the url/setting to disable the unifiedgroupwelcomemessageenabled via the msgraph?

I can't find a way either. We've created a dedicated powershell function app specifically to disable the welcome mail.

You can do that with Microsoft Graph only at creation time. I'm disabling the member notification on group adding like this:

 

Like this:

Url: https://graph.microsoft.com/v1.0/groups

Request Body:

--

{
    "displayName": "TestGroup-01",
    "groupTypes": [
        "Unified"
    ],
    "mailEnabled": true,
    "mailNickname": "testgroup-01",
    "resourceBehaviorOptions": [
        "WelcomeEmailDisabled"
    ],
    "securityEnabled": false,
    "visibility": "Private",
}

--

 

Thanks!

The documentation does not mention this (new) property.. How did you get this information?

 

Great! I can confirm this works to disable the welcome email on site creation:
"resourceBehaviorOptions": [
"WelcomeEmailDisabled"
],

I don't know where you found this because there is no mention of this command anywhere but I'm glad you posted it.

@Matthias Habegger 

 

Thanks for posting this! Can you post where you found this? I'm curious as to the other options available within the resourceBehaviorOptions attribute. Thanks

@Julian_Dano @Matthias Habegger 

 

Values for resourceBehaviorOptions:

  • AllowOnlyMembersToPost
  • CalendarMemberReadOnly
  • ConnectorsEnabled
  • HideGroupInOutlook
  • NotebookForLearningCommunitiesEnabled
  • ReportToOriginator
  • SharePointReadonlyForMembers
  • SubscriptionEnabled
  • SubscribeMembersToCalendarEvents
  • SubscribeMembersToCalendarEventsDisabled
  • SubscribeNewGroupMembers
  • WelcomeEmailDisabled
  • WelcomeEmailEnabled
@ShaneOss,
Unfortunately I am not able to find resourceBehaviorOptions attribute in graph api. Graph API is up to date, but till this attribute is missing. Kindly suggest