Dynamic Distribution Groups

Copper Contributor


It is desirable that all dynamic distribution groups get the filter "AccountEnabled -eq $true" and scanners and meeting rooms are filtered out from these lists.

Can you please tell me how can I do it?



1 Reply
There is no AccountEnabled property. There is an AccountDisabled one, but you cannot use it for DDG filters. Instead, you can filter by ExchangeUserAccountControl. Something like this:

Get-Recipient -RecipientPreviewFilter {-not(ExchangeUserAccountControl -eq 2 -and RecipientTypeDetails -eq "RoomMailbox")}