Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using a Wildcard to build an Exchange 2007 address list

Posted on 2009-04-10
2
Medium Priority
?
1,382 Views
Last Modified: 2012-06-22
I am trying to upgrade our LDAP based address lists to OPATH.  I would like to use this syntax to build a new (or upgrade, which ever you prefer) dynamic address list but it is not working...  It just does not build the list.  

Set-AddressList 'Microsoft' -RecipientFilter { (RecipientType -eq 'MailContact' -and EmailAddresses -eq '*@Microsoft.com') }

However, when I use either one of the following it works; assuming the mail contact has "Microsoft" in the description field or I specify an exact email address and remove the Wildcard.

Set-AddressList 'Microsoft' -RecipientFilter { (RecipientType -eq 'MailContact' -and Description -eq 'Microsoft') }

This would be fine if I did not have to go through hundreds and hundreds of contacts and update their description...

or

Set-AddressList 'Microsoft' -RecipientFilter { (RecipientType -eq 'MailContact' -and EmailAddresses -eq 'UserEmail@Microsoft.com') }

This one just builds the list with the one person's email address...

Any help is much appreciated.  Thank you in advance.

Simon

0
Comment
Question by:pamplinit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
MarcSpencer earned 2000 total points
ID: 24121022
Set-AddressList 'Microsoft' -RecipientFilter { (RecipientType -eq 'MailContact' -and EmailAddresses -eq '*@Microsoft.com') }

You can't use -EQ and wildcards. You need to use -LIKE and the the wildcard.

Set-AddressList 'Microsoft' -RecipientFilter { (RecipientType -eq 'MailContact' -and EmailAddresses -like '*@Microsoft.com') }
0
 

Author Comment

by:pamplinit
ID: 24122783
I swear I tried using the "like" operator and it did not work...  

Oh well, It did this time.

MarcSpencer -  You are the man!  Thank you for your help.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question