共用方式為


UserProfileManager.CreateUserProfile Method (String, String)

Creates a user profile with the specified account name and preferred name.

Namespace:  Microsoft.Office.Server.UserProfiles
Assembly:  Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)

Syntax

'Declaration
Public Function CreateUserProfile ( _
    strAccountName As String, _
    strPreferredName As String _
) As UserProfile
'Usage
Dim instance As UserProfileManager
Dim strAccountName As String
Dim strPreferredName As String
Dim returnValue As UserProfile

returnValue = instance.CreateUserProfile(strAccountName, _
    strPreferredName)
public UserProfile CreateUserProfile(
    string strAccountName,
    string strPreferredName
)

Parameters

  • strAccountName
    Type: System.String

    The account name of the user profile.

  • strPreferredName
    Type: System.String

    The preferred name of the user profile.

Return Value

Type: Microsoft.Office.Server.UserProfiles.UserProfile
that represents a user profile with the specified account name and preferred name.

Remarks

To create your own user profile you must have PortalRight.UseSubscription permission. To create a user profile for another user you must have PortalRight.ManageUserProfile permission. To create your own user profile on the Web you must pass a string containing "UsePersonalFeatures".

See Also

Reference

UserProfileManager Class

UserProfileManager Members

CreateUserProfile Overload

Microsoft.Office.Server.UserProfiles Namespace