Exchange 2007 Custom Address List

I am in the process of creating a custom address list in exchange 2007. The list needs to contain all mail contacts with a smtp address of *@domainX.com. The only options other than state, department, and company are custom attributes. Does anyone know the sytax for custom attribute that can filter based on smtp address?
LVL 3
jlamb87Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AkhaterCommented:
you will have to create the distribution group using power shell something like
new-DynamicDistributionGroup -Name 'Group Name' -Alias "GroupAlias" -OrganizationalUnit 'Domain.com/Distribution Groups' -RecipientFilter {(PrimarySmtpAddress  -like '*@domain.com') -and (RecipientType -eq 'UserMailbox' -or RecipientType -eq 'MailUser')} -RecipientContainer 'domain.com'

Open in new window

0
jlamb87Author Commented:
Well I need a custom address list ( think GAL), not a distribution group.Or am mis-interpreting your advice?
0
AkhaterCommented:
I am sorry I have miss read you OP !

I thought you were talking about a dynamic distribution group, however the same holds true

use

New-AddressList -Name MyAddressList -RecipientFilter  {((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Washington')

new-AddressList -Name MyAddressList -RecipientFilter {(PrimarySmtpAddress  -like '*@domain.com') -and (RecipientType -eq 'UserMailbox' -or RecipientType -eq 'MailUser')}

Open in new window

0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

jlamb87Author Commented:
Will be looking into it, but posting here in the mean time, i ran this command,



New-AddressList : Cannot bind parameter 'RecipientFilter' to the target. Except
ion setting "RecipientFilter": "Property PrimarySmtpAddress does not support Mi
crosoft.Exchange.Data.TextFilter. Only Microsoft.Exchange.Data.ComparisonFilter
 is supported."
new-AddressList -Name MDI Distribution List -RecipientFilter {(PrimaryS
mtpAddress  -like '*@morphodetection.com') -and (RecipientType -eq 'contact')}

Open in new window

0
jlamb87Author Commented:
meant to say, i ran that code, and received that error...
0
jlamb87Author Commented:
also, not sure if    (RecipientType -eq 'contact')   is valid. was testing that.
0
AkhaterCommented:
if the primarysmtpaddress is not a filterable property then it cannot be done. I will  need to digg this more for you
0
jlamb87Author Commented:
if not, i am willing to filter by company (which is a predefined filter). But do you know a command that will add a company name to group of contacts? their unique properties are smtpaddress and OU. i have a .csv that i used to import these contacts that has the display name and external address. i used -importcsv to create them.
0
AkhaterCommented:
this shld be easy to do. give me a couple of hours till I reach home & I will give you the code. How are these groupped? in the same ou?
0
jlamb87Author Commented:
yea, its exchange07, but they are in a unique OU (can use any variable). They also have unique email domains. Not sure which is easier to use. I am doing some research on it now, ill post if i find anything. I cant create any script, but can modify something if i find anything close.
0
AkhaterCommented:
Sorry I am back

try something similar to

get-mailcontact -organizationalunit "domain.com/ou" | set-contact -company "whatever"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.