Question

The protocolSettings attribute of get-mailbox can return multiple values depending upon what is enabled or disabled. By default, when a new user is created, none of the attributes exist until they are enabled or disabled.

I want to return all the protocolSettings from Get-Mailbox using the -filter to optimize the command by not piping to Where or Select. This should reduce the amount of records returned before I use a pipe.

Piping Select will give me the output, but again, I want to avoid the pipe and use the -filter:

Get-Mailbox  | select ProtocolSettings

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

Is there a way to use the -filter to return what I am geting in the Select pipe?

I have tried:

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

Anyone know a way to return all the ProtocolSettings from the -filter parameter?

The full commnad I am using is as follows:

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

Solution

Not all properties are filterable.

Here's a like to the filterable properties for Exchange 2010:

Filterable Properties for the -Filter Parameter

That being said, you can do late filtering on that property from get-mailbox using text comparison (like, match, etc.) The individual protocols are exposed as individual properties with boolean Enabled settings from Get-CASMailbox.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top