Hi,
Could you please share the detailed version of your exchange server?
Get-Exchangeserver | select name,admindisplayversion
Please note that Exchange 2010 support is till October 2020, so plan for the upgrade of exchange to the supported versions.
If I understood correctly, you are looking to exclude the users in dynamic distribution lists. Disabled AD accounts, hidden from GAL accounts. If so, please try the below command to exclude the disabled AD accounts in dynamic distribution lists,
Set-DynamicDistributionGroup -name "New List " -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (HiddenFromAddressListsEnabled -eq 'True'))}
Set-DynamicDistributionGroup -name "New List " -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(UserAccountControl -like 'AccountDisabled') )}