Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1768
  • Last Modified:

Create Global Address List using a Recipient Filter with two or more custom Attributes

I am trying to create a new Global Address List in Exchange 2010 using a recipient filter with two or more custom attributes.

New-GlobalAddressList -Name "GAL_HSMS" -RecipientFilter {((CustomAttribute1 -like "HSMS") -and (CustomAttribute2 -like "Faculty") -and (CustomAttribute3 -like "Staff"))}

Command executes without an error, however run I run the Update-GlobalAddressList -Identity "GAL_HSMS" it returns 0 users.

Any Help would be appreciative.

thanks,
Scott
0
scotth4711
Asked:
scotth4711
  • 4
1 Solution
 
Gareth GudgerCommented:
Have you already set these custom attributes on these mailboxes?

For example, Set-Mailbox -CustomAttribute3 "Staff"
0
 
scotth4711Author Commented:
Yes, all the attributes have been assigned, and works fine if I use a single attribute, just doesn't work if I use multiple attributes.
0
 
scotth4711Author Commented:
Ok, I know what I was doing wrong, I was writing three And Statements rather than 1 and and 1 or statement.

So I would need Attribute1 = hsms and or attribute2 = faculty or attribute3 = staff.  not sure if this can be done, I may just need to use another attribute as fac_staff.
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

 
scotth4711Author Commented:
Recipients filter:
((CustomAttribute1 -eq 'HSMS') -and (((CustomAttribute2 -eq 'Faculty') -or (CustomAttribute3 -eq 'Staff'))) -and (Alias -ne $null))
0
 
scotth4711Author Commented:
Kept Playing around till I got it.
0
 
AdvizorCommented:
Hi Guys

Whats the syntax if i need to input variables?
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.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now