Remove-MapiRecipient

Description

This cmdlet removes one or more recipients from a message.

Syntax
Note: Parameters in orange are optional.
Remove-MapiRecipient
-MessageMapiObject<Mapi.NET.Message>
-RecipientEntryMapiObject<Mapi.NET.Recipient>[]
Remove-MapiRecipient
-MessageMapiObject<Mapi.NET.Message>
-AddressString[]
Parameters
MessageA Mapi.NET.Message from which recipients are removed.
RecipientEntryA list of one or more Mapi.NET.Recipient objects each representing a recipient to be removed.
AddressA list of one or more email addresses each representing a recipient to be removed.
Remarks

This cmdlet removes recipients from a message's internal recipient table.

MAPI messages contain a table of recipients that are a listing of all recipients of the message.  All recipient types are in this table:  TO, CC, and BCC (if present).  BCC recipients are removed by a messaging transport and as such only drafts and copies of the original message in a "sent items" folder would still contain BCC recipients.

When the Address parameter is used, each address is resolved against the message's Session object in order to get the recipient entry and then compared to each recipient in the table.  Only matching recipients are removed.

When the RecipientEntry parameter is used, each recipient in the table is compared to each value in the parameter for a match.  Only matching recipients are removed.