Saturday, November 2, 2013

Update LDAP queries to OPATH for Exchange 2010

Starting with Exchange 2007, OPATH is the filtering syntax used by PowerShell, replacing the ugly syntax used in Exchange 2003, and it allows for filters which are easier to create.
If you haven't updated your lists yet, you'll probably see messages in the EMC like: "The address list couldn't be edited. Address lists created with legacy versions of Exchange must be updated..."

You can update your lists with PowerShell.

To convert the default lists, run these:

Set-AddressList “All Users” –IncludedRecipients MailboxUsers

Set-AddressList "All Groups" -IncludedRecipients MailGroups

Set-AddressList "All Contacts" -IncludedRecipients MailContacts

Set-AddressList "Public Folders" -RecipientFilter { RecipientType -eq 'PublicFolder' }

For the Default GAL, run:

Set-GlobalAddressList "Default Global Address List" -RecipientFilter {(Alias -ne $null -and (ObjectClass -eq 'user' -or ObjectClass -eq 'contact' -or ObjectClass -eq 'msExchSystemMailbox' -or ObjectClass -eq 'msExchDynamicDistributionList' -or ObjectClass -eq 'group' -or ObjectClass -eq 'publicFolder'))}

For custom built LDAP filters, download and run this script.

No comments:

Post a Comment