New Dynamic Group Azuread Powershell

I am trying to make a dynamic group in AzureADMS, but I get the error message "A parameter cannot be found that matches parameter name 'MembershipRule'." This is my command:

New-AzureADMSGroup `
    -DisplayName "IT"`
    -Description "IT-department" `
    -MailEnabled $False `
    -SecurityEnabled $True `
    -MailNickName "IT" `
    -GroupTypes "DynamicMembership" `
    -MembershipRule "user.department -eq "IT"" `
    -MembershipRuleProcessingState "On"

Could you please help?

Other inputs are also welcome.

5

1 Answer

I tried to reproduced in my environment and got similar error.

The error occurs as you may have had incorrect module AzureAD. So I uninstall Azure AD module and install AzureADPreview by running this command

 Uninstall-module AzureAD

Instead of Azure AD used AzureADPreview

Install-module AzureADPreview

After installed AzureADPreview, I runned your commands and got an output Successfully.

Portal:

Reference: New-AzureADMSGroup (AzureADPreview) | Microsoft Learn

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest