【问题标题】:PowerShell get-mailbox filter on protocolSettingsprotocolSettings 上的 PowerShell 获取邮箱过滤器
【发布时间】:2013-04-09 20:51:26
【问题描述】:

get-mailbox 的 protocolSettings 属性可以返回多个值,具体取决于启用或禁用的内容。默认情况下,当创建新用户时,在启用或禁用之前,所有属性都不存在。

我想使用 -filter 从 Get-Mailbox 返回所有协议设置,以通过不通过管道传输到 Where 或 Select 来优化命令。这应该会减少在我使用管道之前返回的记录数量。

Piping Select 会给我输出,但我想再次避开管道并使用 -filter:

Get-Mailbox  | select ProtocolSettings

{MAPI§1§§§§1§§§, HTTP§0§1§§§§§§, OWA§0, RemotePowerShell§1}

有没有办法使用 -filter 来返回我在 Select 管道中得到的内容?

我试过了:

Get-Mailbox  -Filter {(ProtocolSettings)}
Cannot bind parameter 'Filter' to the target. Exception setting "Filter":
 "Invalid filter syntax

有人知道从 -filter 参数返回所有 ProtocolSettings 的方法吗?

我使用的完整命令如下:

get-mailbox -OrganizatinalUnit 'OU=test,DC=Domain,DC=com' `
-filter {(CustomAttribute14 -eq 'Test') -and (ProtocolSettings)}

【问题讨论】:

    标签: powershell active-directory exchange-server-2010


    【解决方案1】:

    并非所有属性都可过滤。

    以下是 Exchange 2010 的可过滤属性:

    Filterable Properties for the -Filter Parameter

    话虽如此,您可以使用文本比较(例如、匹配等)从 get-mailbox 对该属性进行后期过滤。各个协议作为单独的属性公开,并从 Get-CASMailbox 中启用布尔设置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-03
      • 1970-01-01
      • 1970-01-01
      • 2013-08-15
      • 2011-05-26
      • 1970-01-01
      • 2010-09-29
      相关资源
      最近更新 更多