Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add all ResourceBehaviorOptions to New-PnPSite or Set-PnPMicrosoft365Group #3832

Open
wfi-jonas opened this issue Mar 18, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@wfi-jonas
Copy link

Is your feature request related to a problem? Please describe.
We are creating new teams in team by first creating a SharePoint team site via New-PnPSite in order to configure the site language. This is because there is no option to provide a site language value when creating a team.

After we created the SPO site, we can teamify the M365 group using this command: New-PnPTeamsTeam -GroupId ($createdSite.groupId).guid

sadly new-pnpteamsteam states: Allows providing ResourceBehaviorOptions which accepts multiple values that specify group behaviors for a Microsoft 365 Group. This will only work when you create a new Microsoft 365 Group, it will not work for existing groups.

Describe the solution you'd like
I would like to be able to create a team site and configure the group with ResourceBehaviorOptions in order to disable the welcome email and remove the group from outlook, either during creation of the new-pnpsite cmdlet or after via Set-PnPMicrosoft365Group.

OR being able to create a team and provide the language for the backend SharePoint site. But I don't think this is possible as graph doesn't seem to have an option to provide a language during teams creation..

Describe alternatives you've considered
Via Set-PnPMicrosoft365Group I can use this parameter: -HideFromOutlookClients
But I can't see a parameter to disable the welcome mail. There is also this: Set-UnifiedGroup -Identity $GroupId -UnifiedGroupWelcomeMessageEnabled:$false

@wfi-jonas wfi-jonas added the enhancement New feature or request label Mar 18, 2024
@jackpoz
Copy link
Contributor

jackpoz commented Mar 20, 2024

When using Graph, ResourceBehaviorOptions are supported only on creation, so they cannot be changed on updates.
See https://learn.microsoft.com/en-us/graph/group-set-options#resource-behavior-options:

resourceBehaviorOptions is a string collection that specifies group behaviors for a Microsoft 365 group. These behaviors can be set only on group creation.

https://learn.microsoft.com/en-us/graph/api/group-update?view=graph-rest-1.0&tabs=http shows which properties can be updated, including hideFromOutlookClients which is used by Set-PnPMicrosoft365Group.

If you find an API to change these settings after the creation, then they can be used by PnP too, otherwise it's not possible to implement what the feature you are describing.

@wfi-jonas
Copy link
Author

what about this setting? Looks like something you can configure after creation..

Set-UnifiedGroup

-UnifiedGroupWelcomeMessageEnabled
The UnifiedGroupWelcomeMessageEnabled switch specifies whether to enable or disable sending system-generated welcome messages to users who are added as members to the Microsoft 365 Group.

To enable this setting, you don't need to specify a value with this switch.
To disable this setting, use this exact syntax: -UnifiedGroupWelcomeMessageEnabled:$false.
This setting only controls email send by the Microsoft 365 Group. It doesn't control email sent by connected products (for example, Teams or Viva Engage).

This setting is enabled by default.

https://learn.microsoft.com/en-us/powershell/module/exchange/set-unifiedgroup?view=exchange-ps

@jackpoz
Copy link
Contributor

jackpoz commented Mar 21, 2024

That uses the exchange powershell module https://learn.microsoft.com/en-us/powershell/module/exchange/?view=exchange-ps and uses Exchange specific APIs, not Microsoft Graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants