Code to Retrieve Custom Attributes on Profile Properties

This sample describes how to access custom attributes defined on profile properties.

  1. If not already connected, create a ProfileService object, oProfileService, and establish a connection to the profile store. For information about connecting to the Profile Store, see Code to Connect to the Profile Store.

  2. Retrieve the profile object by specifying the schema name, and either the primary key value or a key name/value pair of the ProfileObject object. The UserObject schema type has a primary key of logon_name and a join key of user_id. The join key is a globally unique identifier (GUID). For more information on the valid profile schema types, see Profile Schema. Retrieve the oUser1 profile created in Code to Create a New Profile.

  3. Retrieve the IsExported custom attribute defined on first_name.

    Set IsExported = oUser1.GeneralInfo.first_name.Properties("IsExported")
    

Copyright © 2005 Microsoft Corporation.
All rights reserved.