Link to home
Start Free TrialLog in
Avatar of scotth4711
scotth4711

asked on

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
Avatar of Gareth Gudger
Gareth Gudger
Flag of United States of America image

Have you already set these custom attributes on these mailboxes?

For example, Set-Mailbox -CustomAttribute3 "Staff"
Avatar of scotth4711
scotth4711

ASKER

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.
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.
ASKER CERTIFIED SOLUTION
Avatar of scotth4711
scotth4711

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Kept Playing around till I got it.
Hi Guys

Whats the syntax if i need to input variables?