Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global Address List Segregation with multiple conditions

Status
Not open for further replies.

ncotton

IS-IT--Management
Jan 27, 2006
2,841
0
0
GB
Hi guys,
I'm trying to create a second Global Address list that only contains 2 things. Mailboxes from my domain (not including external contacts that have been made into custom address lists), and also any distribution groups.

I have tried several comands, which all "complete", but show no members.

I've tried this, with all Mailboxes listed with "MyCompany" in the company parameter, and including Distribution Groups.
Code:
New-GlobalAddressList -Name "NEW GAL" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (Company -eq 'MyCompany')) -or (RecipientType -eq 'MailUniversalDistributionGroup')}

I have tried this, by specifying "MyCompany" as the value of CustomAtribute1
Code:
New-GlobalAddressList -Name "NEW GAL" -ConitionalCustomAttribute1 "MyCompany" -IncludedRecipients AllRecipients

I have tried many bits of this, even just using a new GAL with just include all ditribution groups, and none of them work.

The only thing I can get to return values is
Code:
New-GlobalAddressList -Name "NEW GAL" -ConditionalCompany "MyCompany" -IncludedRecipients MailboxUsers

This would be fine, if I could also add any distribution group that exists to this GAL.

This is driving me nuts.

thanks in advance

Neil J Cotton
 
I've cracked it. Very strange. Seems to be a problem with the ASCII character inputs. Even though the text in the custom attributes is correct (identical and spelt correctly compared to the PS condition), it only seems to work when I copy the text from the actual line of PS, or build the PS script using a COPY and PASTE of the content of the attribute.

I know this doesn't sound possible, but I do recall having exactly the same problem with another PS scripting issue I had a while back.

If anyone can explain this, or have had a similar issue I would be very greatful.

FYI. This is the code that worked (after I replaced the CustomAttribute1 with a copy and paste of the content of the PS script condition.

Code:
New-GlobalAddressList -Name "AGCCE GAL7" -ConditionalCustomAttribute1 MyCompany -IncludedRecipients AllRecipients

Neil J Cotton
 
Thanks for letting us know what resolved it. I have had this happen to me too, although in a different context. Very strange.

Dave Shackelford
ThirdTier.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top