Creating Dynamic Groups Using New-AzureADMSGroup

Asked 2 years ago, Updated 2 years ago, 138 views

We aim to use PowerShell to create dynamic groups for MS365.
Dynamic groups cannot be created using the examples described in the official reference.
I'd like to ask you to teach me.

PSC:\>New-AzureADMSGroup-DisplayName "Dynamic Group 01" - Description "Dynamic Group created from PS" - MailEnabled $False-MailNickName "group" - SecurityEnabled $True-GroupTypes "DynamicMembership" -Membership(Membership)

The following error will appear for this:

New-AzureADMSGroup: No matching parameter found for parameter name 'membershipRule'.

I suspect AzureAD will not be able to create dynamic groups despite the references (do I need to use ExchangePowerShell?).

azure powershell microsoft-graph microsoft-teams

2022-09-30 19:47

1 Answers

Are you using AzureAD module or AzureADPreview module?It seems that AzureADPreview supports membershipRule.If you are using the AzureAD module, could you try the AzureADReview module?

Reference: https://github.com/MicrosoftDocs/azure-docs/issues/34263#issuecomment-510978402


2022-09-30 19:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.