Reputation: 59
I'm trying to create dynamic groups in azure ad using below powershell command:
New-AzureADMSGroup -DisplayName "us_demo_group" -Description "This group contains information of users from us domain" -MailEnabled $False -MailNickName "group" -SecurityEnabled $True -GroupTypes "DynamicMembership" -membershipRule "(user.department -contains ""Marketing"")" -membershipRuleProcessingState "On"
Reference link: https://learn.microsoft.com/en-us/powershell/module/azuread/new-azureadmsgroup?view=azureadps-2.
While executing this command I get below error :
> New-AzureADMSGroup : A parameter cannot be found that matches
> parameter name 'membershipRule'.
I have imported both the azureAD and azureADPrewview modules. I have global administartor role and Azure AD Premium P2 set up.
Upvotes: 3
Views: 8453
Reputation: 1
if you still getting the error then remove the AzureAD module first and then import azureADpreview
Remove-Module AzureAD -ErrorAction SilentlyContinue
Import-Module AzureADPreview
Upvotes: 0
Reputation: 3505
Ensure you're using the AzureADPreview and not the AzureAD.
In case you have both installed open a new powershell window and import the preview one like this:
Import-Module AzureADPreview
Upvotes: 4