Bug in PowerShell for Exchange Online

PFS IT 21 Reputation points


Just a quick question; Is this maybe a bug?


With the -Filter parameter, no matching group is found but with "Where" the desired group is found.

Microsoft Office Online Server
Microsoft Office Online Server
Microsoft on-premises server product that runs Office Online. Previously known as Office Web Apps Server.
609 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,435 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 100.6K Reputation points MVP

    Hi @PFS IT ,

    please try this (not tested):

    Get-DistributionGroup -Filter "Name -eq '$GroupName'"  


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Andreas Baumgarten

2 additional answers

Sort by: Most helpful
  1. Rich Matheisen 45,431 Reputation points

    The -Filter takes a string as an argument, not a code block. It's a good idea to consult the help for a cmdlet (either online or using help cmdlet-name).


    Follow Andreas' advice. ;-)

  2. Limitless Technology 39,471 Reputation points

    Hello PFSIT,

    The Filter parameter indeed takes strings and not code blocks, so it should be between quotes, also would like to introduce you to the tested properties to be applicable for the Filter parameter in Exchange.


    Hope this may be helpful for you,
    Best regards,

    0 comments No comments