none
New Address list RecipientFilter invalid filter syntax RRS feed

  • Question

  • I'm trying to add a very simple address list to our address book. Very simply, I want an "All Equipment" category. This document lists RecipientTypeDetails as a valid property to filter. So this should be simple.

    However, running the following:

    New-AddressList -Name "All Equipment" -RecipientFilter {(RecipientTypeDetails –eq "EquipmentMailbox")}

    results in the following error: Cannot bind parameter 'RecipientFilter' to the target. Exception setting "RecipientFilter": "Invalid filter syntax. For a description of the filter parameter syntax see the command help.

    Syntax looks too simple for a mistake to hide, but for the life of me, I don't see it. What am I missing?

    Monday, February 16, 2015 9:18 PM

Answers

  • This one works for me:

    PS C:\> New-AddressList "All Equipment" -RecipientFilter {RecipientTypeDetails -eq 'EquipmentMailbox'}
    
    Name                      DisplayName               RecipientFilter
    ----                      -----------               ---------------
    All Equipment             All Equipment             RecipientTypeDetails -eq 'EquipmentMailbox'

    Monday, February 16, 2015 9:58 PM

All replies

  • This one works for me:

    PS C:\> New-AddressList "All Equipment" -RecipientFilter {RecipientTypeDetails -eq 'EquipmentMailbox'}
    
    Name                      DisplayName               RecipientFilter
    ----                      -----------               ---------------
    All Equipment             All Equipment             RecipientTypeDetails -eq 'EquipmentMailbox'

    Monday, February 16, 2015 9:58 PM
  • Thanks. That's simple enough. Every available example had multiple filter conditions, and therefore (multiple sets of) parentheses. 

    I don't suppose you know where I could discover why superfluous parentheses are considered a syntax error? As a completely self taught PowerShell user with no professional programming training, this sort of thing just makes no sense. My 7th grade algebra teacher taught me that 5+7 = (5+7). Even Excel thinks this is true. 

    Tuesday, February 17, 2015 2:38 PM