我尝试运行以下命令:
New-DynamicDistributionGroup -Name "All Company Office"
-OrganizationalUnit 'domain/A1/Distribution Groups'
-RecipientFilter {((RecipientType -eq 'UserMailbox')
-and (Office -eq 'Fornebu')
–and (Company -eq 'Broadnet'))}
-RecipientContainer 'domain/A1/Users'
但是我收到以下错误:
New-DynamicDistributionGroup : Cannot bind parameter 'RecipientFilter' to the target.
Exception setting "RecipientFilter": """ is not a valid operator. For a list of
supported operators see the command help.
"((RecipientType -eq 'UserMailbox') -and (Office -eq 'Fornebu') –and (Company -eq
'Broadnet'))" at position 64."
At line:1 char:140
+ New-DynamicDistributionGroup -Name "_TESTDG Alle Broadnet Fornebu"
-OrganizationalUnit 'corp.local/A1/Distribution Groups' -RecipientFilter <<<<
{((RecipientType -eq 'UserMailbox') -and (Office -eq 'Fornebu')
–and (Company -eq 'Broadnet'))} -RecipientContainer 'corp.local/A1/Users'
+ CategoryInfo : WriteError: (:) [New-DynamicDistributionGroup],
ParameterBindingException
+ FullyQualifiedErrorId :
ParameterBindingFailed,Microsoft.Exchange.Management.RecipientTasks.NewDynamicDistributionGroup
我试过“谷歌”无济于事。 请帮忙:) (顺便使用PowerShell 2.0)
答案 0 :(得分:1)
This暗示过滤器的括号有问题。试试这个:
-RecipientFilter {((RecipientType -eq 'UserMailbox') -and (Office -eq 'Fornebu' -and Company -eq 'Broadnet'))}
答案 1 :(得分:1)
问题是我通过浏览器复制了示例代码..我用自己的代码替换了所有粘贴的破折号( - )并且它有效......很奇怪!