Click to Rate and Give Feedback
Community Content
In this section
Statistics Annotations (0)
Collapse All/Expand All Collapse All
ProfileSubtypeManager Class

Creates, deletes, retrieves, and manages profile subtypes for a profile type.

System..::.Object
  Microsoft.Office.Server.UserProfiles..::.ProfileSubtypeManager

Namespace:  Microsoft.Office.Server.UserProfiles
Assembly:  Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)
Visual Basic (Declaration)
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Class ProfileSubtypeManager
Visual Basic (Usage)
Dim instance As ProfileSubtypeManager
C#
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class ProfileSubtypeManager

The following sample demonstrates how to use the ProfileSubtypeManager to create both a user profile and an organization profile ProfileSubtype.

using Microsoft.Office.Server.UserProfiles;
using Microsoft.SharePoint;
 
namespace CreateSubtype
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite site = new SPSite("http://<servername>"))
            {
                SPServiceContext context = SPServiceContext.GetContext(site);
                ProfileSubtypeManager psm = ProfileSubtypeManager.Get(context);
 
                // create a user profile subtype
                psm.CreateSubtype("Consultant", "Consultant Subtype", ProfileType.User);
 
                // create an organization profile subtype
                psm.CreateSubtype("Vendor", "Vendor Subtype", ProfileType.Organization);
            }
        }
    }
}
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker