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.

enter image description here

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

enter image description here

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

enter image description here

Portal:enter image description here

Reference:New-AzureADMSGroup (AzureADPreview) | Microsoft Learn

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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.

You Might Also Like