UserProfileManager.GetStringSinglePropertyValueForUser Method

Retrieves the single-valued property for the UserProfile whose name matches the propertyName parameter of the UserProfile identified by the accountName parameter.

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

Syntax

'Declaration
Public Shared Function GetStringSinglePropertyValueForUser ( _
    serviceContext As SPServiceContext, _
    propertyName As String, _
    accountName As String _
) As String
'Usage
Dim serviceContext As SPServiceContext
Dim propertyName As String
Dim accountName As String
Dim returnValue As String

returnValue = UserProfileManager.GetStringSinglePropertyValueForUser(serviceContext, _
    propertyName, accountName)
public static string GetStringSinglePropertyValueForUser(
    SPServiceContext serviceContext,
    string propertyName,
    string accountName
)

Parameters

  • accountName
    Type: System.String

    The account name of the requested user profile.

Return Value

Type: System.String
A string representing a single-valued property.

Exceptions

Exception Condition
ArgumentNullException

serviceContext is a null reference (Nothing in Visual Basic).

accountName is a null reference (Nothing in Visual Basic).

InvalidOperationException

propertyName is a null reference (Nothing in Visual Basic) or an empty string.

accountName is a null reference (Nothing in Visual Basic) or an empty string.

See Also

Reference

UserProfileManager Class

UserProfileManager Members

Microsoft.Office.Server.UserProfiles Namespace