Set-MapiProp

Description

This cmdlet adds or modifies the value of one or more properties of an object that supports properties.

Syntax
Note: Parameters in orange are optional.
Set-MapiProp
-MapiItemIMapiObject
-PropIDMapi.NET.Tags
-ValueObject
Set-MapiProp
-MapiItemIMapiObject
-PropNameString
-ValueObject
Set-MapiProp
-MapiItemIMapiObject
-PropValuesMapi.NET.Wrappers.PropValue()
Set-MapiProp
-MapiItemIMapiObject
-PropsPowerMapi.Commands.MapiProp
Set-MapiProp
-MapiObjectMapi.NET.Wrappers.MapiProps
-PropIDMapi.NET.Tags
-ValueObject
Set-MapiProp
-MapiObjectMapi.NET.Wrappers.MapiProps
-PropNameString
-ValueObject
Set-MapiProp
-MapiObjectMapi.NET.Wrappers.MapiProps
-PropValuesMapi.NET.Wrappers.PropValue()
Set-MapiProp
-MapiObjectMapi.NET.Wrappers.MapiProps
-PropsPowerMapi.Commands.MapiProp
Parameters
MapiItemA PowerMapi.Commands.IMapiObject that is a generic interface on most objects returned by PowerMapi.
MapiObjectA Mapi.NET.Wrappers.MapiProps object that is a base class of most MAPI objects with properties.
PropIDOne of the values from the Mapi.NET.Tags enumeration, or an unsigned 32bit integer of the property to be set.
PropNameA string value that equates to one of the values in Mapi.NET.Tags, or a hex string (prefixed with '0x') that equates to a 32bit unsigned integer of the property to be set.
ValueThe value of the property to be set.
PropValuesA list of one or more Mapi.NET.Wrappers.PropValue objects, each a specific property and value to be set.
PropsA PowerMapi.Commands.MapiProp object, which is a dictionary of properties with the Key being the property ID and the Value being the value of the property to set.
Remarks

This cmdlet can add or modify one or more properties of an object.  There are many MAPI objects that support properties such as:  Message, Store, Folder, Attachment, Recipient, Profile Provider and Service.  These are the most common, but not necessarily all object types.

When using the PropID + Value or PropName + Value combinations, only one property can be set at a time with this cmdlet.  To set multiple properties, use either the Props or PropValues parameter options.

The New-MapiProp cmdlet can also be use to create property objects that can be used with the PropValues parameter.

Note that for many objects that support properties the process is a 2-step process of setting values and then committing those values to the object thru a "save changes" method.  This cmdlet automatically calls the "save changes" method on the specified object.  As such, when setting multiple properties it is recommended to use the Props or PropValues syntax of this cmdlet so that the list of properties can be committed to the object in a single event.  While no issue will occur by looping over properties and calling Set-MapiProp successively, for network based stores like an Exchange mailbox, it creates much more network traffic than a single Set-MapiProp call for a list of values.