We have a Server 2008 / Exchange 2007 box, where all our users' mailboxes live. We also have a number of distribution lists, both static and dynamic. One dynamic DL is called "Everyone" and contains, predictably enough, all the users with Exchange mailboxes.
The problem is, we also have a small number of users in a separate mailbox DB who don't technically work for us and shouldn't appear in the "Everyone" list. Even though I've checked the "Hide from exchange address lists" on all the offending users, they still show up in the preview and also (as I've just found out) receive any mail sent to it.
Is there any way of excluding these users from the DDL's filter, possibly using some PowerShell-fu, or am I going to have to create a static DL and keep it up-to-date?
Ya, this will require a little bit of PowerShell. I found this article that should be a good starting point for you.
I've modified it here and it works for me. You may want to edit to add the OU you want this in, names, aliases, etc.
Copy and paste that code into a text file, edit it to personalize it and then save it with a .PS1 file extension. Open the Exchange PowerShell, browse to the folder where the file is located and run it with .\Filename.PS1
You can't.
Hide from exchange address lists only prevents them from auto completing in outlook.
A solution might be to have the list look only in a certain OU or if they are in a separate mailstore use that as the query.
I have my contractors sitting in a separate OU from the rest of the regular employees.