2

我尝试运行以下命令:

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)

4

2 回答 2

1

问题是我通过浏览器复制了示例代码。我用我自己的替换了所有粘贴的破折号(-),它起作用了……奇怪!

于 2012-10-03T08:44:05.990 回答
1

暗示过滤器的括号有问题。试试这个:

-RecipientFilter {((RecipientType -eq 'UserMailbox') -and (Office -eq 'Fornebu' -and Company -eq 'Broadnet'))}
于 2012-10-02T20:12:59.637 回答