Dynamic distribution group with enabled accounts only

exchangeexchange-2007

Is it possible to add a condition to dynamic distribution group in Exchange 2007 that will filter for enabled accounts only?

When a staff member leaves we have to keep their account in the system for a certain amount of time because of data protection or something, but eventually the mailboxes get full and start rejecting mail, which is annoying for the senders.

Best Answer

When you disable the user account, be sure to disable the corresponding mailbox as well.

You can then filter on the IsMailboxEnabled property in your distribution groups:

New-DynamicDistributionGroup -Name AllUsersGroup -OrganizationalUnit domain.tld/Users -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(IsMailboxEnabled -eq $false))}
Related Topic