Get-MapiProp

Description

This cmdlet one or more properties from a MAPI object.

Syntax
Note: Parameters in orange are optional.
Get-MapiProp
-MapiItemPowerMapi.Commands.IMapiObject
-PropIDMapi.NET.Tags[]
-PropTypeMapi.NET.Enums.PROP_TYPE[]
-ReturnUnsignedIntegersSwitchParameter
-ReturnBinaryAsStringSwitchParameter
Get-MapiProp
-MapiItemPowerMapi.Commands.IMapiObject
-PropNameString[]
-PropTypeMapi.NET.Enums.PROP_TYPE[]
-ReturnUnsignedIntegersSwitchParameter
-ReturnBinaryAsStringSwitchParameter
Get-MapiProp
-MapiObjectMapi.NET.Wrappers.MapiProps
-PropIDMapi.NET.Tags[]
-PropTypeMapi.NET.Enums.PROP_TYPE[]
-ReturnUnsignedIntegersSwitchParameter
-ReturnBinaryAsStringSwitchParameter
Get-MapiProp
-MapiObjectMapi.NET.Wrappers.MapiProps
-PropNameString[]
-PropTypeMapi.NET.Enums.PROP_TYPE[]
-ReturnUnsignedIntegersSwitchParameter
-ReturnBinaryAsStringSwitchParameter
Parameters
MapiItemA PowerMapi.Commands.IMapiObject object from which to retrieve properties. See remarks.
MapiObjectA Mapi.NET.Wrappers.MapiProps object from which to retrieve properties. See remarks.
PropIDOne or more Mapi.NET.Tags values indicating the properties to find and retrieve from the object.
PropNameOne or more string values that can be equated to a MAPI property from the Mapi.NET.Tags enumeration, or a HEX value of a specific property, or a wildcard string that can be partially matched to one or more Mapi.NET.Tags values.
PropTypeOne or more of the Mapi.NET.Enums.PROP_TYPE values used to filter the list of returned properties to only those that match the supplied types.
ReturnBinaryAsStringA SwitchParameter which, if present, will cause binary properties to be converted to a string value. See remarks.
ReturnUnsignedIntegersA SwitchParameter which, if present, will cause integral numbers to be returned as unsigned values.
Remarks

This cmdlet retrieves properties from objects that inherit from Mapi.NET.Wrappers.MapiProps.

Many MAPI objects support the existence of properties, but not all.  For example the Mapi.NET.Session object does not support properties.  Most of the commonly used objects support properties, such as:  Folder, Message, Recipient, Attachment, Store, ProfileProvider, ProfileService, etc..  These object types can be passed to this cmdlet at the MapiObject property.

PowerMapi also attempts to make things easy by naturally accepting input from the output of other PowerMapi cmdlets.  The alternative parameter 'MapiItem' is a generic interface available on all 'MapiObject<Type>' objects.  With this, it is easy to take a list of, for example, MapiObject<Mapi.NET.Message> objects and get specific properties off of them.  Get-MapiItem returns a MapiObject<Mapi.NET.Message> object.

The PropID parameter allows for easy property selection by using the large Mapi.NET.Tags enumeration of over 4000 known properties.  Since this parameter is an enumeration type, tab-completion is available.  Most MAPI props start with a 'PR_' prefix.

The PropName parameter is a multi-use string array to select properties.  If a full property name is provided as a string, and can be matched (with or without the 'PR_' prefix), that property will be used.  Alternatively, and more powerfully, wildcards can be used.  If all of the various EntryID properties were desired, a wild card pattern of *EntryID* could be used.  PowerMapi will compare the pattern against all the Mapi.NET.Tags names for a match.

Lastly, PropName can simply be a hex value representing a specific property, possibly for one that is not well known.  The format in this case is a 5-8 character hex value preceded by either '0x' or '&h'.  For example, 0x3001001F would be the hex property for the unicode version of PR_DISPLAY_NAME.

Note that if neither PropName nor PropID are supplied, the cmdlet will return all properties for the object that currently exist.

The PropType parameter, used with or without PropName/PropID, is used to filter the resulting list of properties to only be those that match the type or types of the PropType parameter.  For example, to ensure that a wildcard PropName parameter will only string properties, PropType could be set to PT_STRING8 or PT_UNICODE.

Sometimes properties that are stored as byte arrays are, or can contain, string values.  The optional SwitchParamter ReturnBinaryAsString can be used to convert the bytes to a character string in the resulting output.  This option simply converts each byte in the array to the character that is associated with the byte value.  This can be especially useful to discover the purpose and/or makeup of a binary property.

The ReturnUnsignedIntegers will taken any non-fractional numeric value and convert it to its unsigned version.