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?
 
AkhaterConnect With a Mentor Commented:
Sorry I am back

try something similar to

get-mailcontact -organizationalunit "domain.com/ou" | set-contact -company "whatever"
0
 
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.