RJHarvey72
asked on
Issues with -RecipientFilter in Exchange Powershell
I am using Powershell to create Dynamic Distribution Groups within Exchange and am having trouble getting it to work with the -like operator. Examples are below of what is working and what isn't working. TechNet suggests that StreetAddress is a string and therefore -like should work with it.
There are good reasons why we aren't simply filtering on the Office attribute and are trying to use Street.
Any help greatly appreciated.
Working
New-DynamicDistributionGro up '# Glasgow' -OrganizationalUnit 'domain/Groups/Distributio n Groups' -RecipientContainer 'domain/User Accounts' -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (StreetAddress -eq '12 High St Glasgow G1 4PT'))}
Not Working
New-DynamicDistributionGro up '# Glasgow' -OrganizationalUnit 'domain/Groups/Distributio n Groups' -RecipientContainer 'domain/User Accounts' -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (StreetAddress -like 'Glasgow'))}
I would simply use the -eq option however one of our office addresses has two apostrophes in it which causes issues.
There are good reasons why we aren't simply filtering on the Office attribute and are trying to use Street.
Any help greatly appreciated.
Working
New-DynamicDistributionGro
Not Working
New-DynamicDistributionGro
I would simply use the -eq option however one of our office addresses has two apostrophes in it which causes issues.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER