question

PFSIT-1772 avatar image
0 Votes"
PFSIT-1772 asked LimitlessTechnology-2700 answered

Bug in PowerShell for Exchange Online

Hi

Just a quick question; Is this maybe a bug?

131685-unbenannt.png

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


windows-server-powershelloffice-online-server-exchange
unbenannt.png (52.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered PFSIT-1772 commented

Hi @PFSIT-1772 ,

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)

Regards
Andreas Baumgarten

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Worked! Thanks!

0 Votes 0 ·
RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered PFSIT-1772 commented

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).

get-distributiongroup

Follow Andreas' advice. ;-)


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yeah, I just assumed it should be a code block because with many other cmdlets, it is one. First time seeing the -Filter parameter being used with quotation marks :) Learning never stops.

0 Votes 0 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

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.

https://docs.microsoft.com/en-us/powershell/exchange/filter-properties?view=exchange-ps

Hope this may be helpful for you,
Best regards,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.