Share via


Item(String) Property

The Item property of the UserProfile class contains a specified property value.

Parameters

strPropName  String The property name.

Property Value

object that contains the specified property value.

The Item property returns the value in the datatype specified in the profile property schema PropertyCollection. When setting a property value, it is expected to be either the correct datatype or a string that can be parsed to the correct datatype. When passing a string, all properties must be formatted using the portal site's culture settings except for dates, which must be formatted using the invariant culture.

Exceptions

Exception Type Condition
UnauthorizedAccessException Attempted to write without write permissions.
PropertyNotEditableException Attempted to write without write permissions on this property.
InvalidValueException Invalid value for this data type.
PropertyInvalidFormatException Invalid format for this data type.
PropertyNotDefinedException Property does not exist.
PropertyIsPrivateException Property is private.

Remarks

If the property is an unique identifier property and if this property is imported from an Active Directory directory service, the return object could be Byte[] instead of Sytem.GUID.

Example

The following code example shows how to retrieve the unique identifier property:

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security