It looks like you’re encountering an issue with the syntax for the RecipientRestrictionFilter
in your PowerShell command. The error might be due to how the extensionattribute01
is being referenced. Here are a few things to check and try:
Ensure the attribute exists and is populated: Verify that extensionattribute01
is indeed synced and contains the value ‘mbx.a1’ for the objects you’re targeting.
- Correct syntax: The syntax you used seems correct, but sometimes PowerShell can be picky about quotes and spaces. Try using double quotes for the entire filter and single quotes inside, like this:
New-ManagementScope`` ``-Name`` ``"CRS1"`` ``-RecipientRestrictionFilter`` ``"extensionattribute01 -eq 'mbx.a1'"``
Check for hidden characters: Sometimes, hidden characters or extra spaces can cause issues. Ensure there are no hidden characters in your script.
- Use
-like
instead of-eq
: If the attribute value might have leading or trailing spaces, using-like
with wildcards can sometimes help:
New-ManagementScope`` ``-Name`` ``"CRS1"`` ``-RecipientRestrictionFilter`` ``"extensionattribute01 -like '*mbx.a1*'"``
- Test the filter separately: Before using it in the
New-ManagementScope
command, test the filter withGet-Recipient
to ensure it returns the expected results:
Get-Recipient`` ``-Filter`` ``"extensionattribute01 -eq 'mbx.a1'"``
If these steps don’t resolve the issue, please provide more details about the error message you’re receiving, and I can troubleshoot further.