Need a little help with a Powershell command regarding 'set-addresslist'

bwinkworth
bwinkworth used Ask the Experts™
on
G'day,
Exchange 2007 SP2
 I've created a new address list with the recipient type being 'Users with Exchange mailboxes' but when I preview it, it also contains my 'Main Board Room' mailbox user which is a resource.
How can I exclude it with powershell. I was trying this:
set-addresslist -identity 'Main Board Room' recipienttype -eq 'UserMailbox' -and -not ...

and that's where I'm stuck.

Thanks all,
BW
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AkhaterSolutions Architect

Commented:


set-addresslist -identity 'Main Board Room' -RecipientFilter {(recipienttype -eq 'UserMailbox') -and (RecipientTypeDetails -ne "RoomMailbox")}

AkhaterSolutions Architect

Commented:
the above was assuming of course then Main Board Room is a room mailbox

Author

Commented:
Thanks Akhater.
I typed in:
set-AddressList -identity 'The new address list' -recipientfilter {(recipienttypedetails -ne "RoomMailbox")}

and it bled on me stating recipienttypedetails used in the filter has unsupported operator NotEqual.

I created the address list using the console and included Users with mailboxes and Mail Enabled Groups so I was now just trying to filter out the 'Main Board Room' resource.

Thanks,
BW
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

can you use -exclude rather than -and -not
Solutions Architect
Commented:
please try
set-AddressList -identity 'The new address list' -recipientfilter {-not(recipienttypedetails -eq "RoomMailbox")}

Author

Commented:
Yep thanks akahater. That worked.
And thanks wittyslogan for your comments.

Appreciate the help guys,
BW

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial