[英]How to create dynamic groups in azure ad through powershell?
I'm trying to create dynamic groups in azure ad using below powershell command:我正在尝试使用以下 powershell 命令在 azure 广告中创建动态组:
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://docs.microsoft.com/en-us/powershell/module/azuread/new-azureadmsgroup?view=azureadps-2 .参考链接: https://docs.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.我已经导入了 azureAD 和 azureADPrewview 模块。 I have global administartor role and Azure AD Premium P2 set up.
我有全局管理员角色和 Azure AD Premium P2 设置。
Ensure you're using the AzureADPreview and not the AzureAD .确保您使用的是AzureADPreview而不是AzureAD 。
In case you have both installed open a new powershell window and import the preview one like this:如果你都安装了打开一个新的 powershell window 并像这样导入预览:
Import-Module AzureADPreview
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.