Share via


SPManagedAccount.Username property

Gets or sets the username.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Property Username As String
    Get
    Set
'Usage
Dim instance As SPManagedAccount
Dim value As String

value = instance.Username

instance.Username = value
public string Username { get; set; }

Property value

Type: System.String
A String identifying the user.

Exceptions

Exception Condition
InvalidOperationException

The set accessor was called more than once.

SPException

The value is not a valid account.

Remarks

The set accessor for this property can be called only once. After that, attempts to call the set accessor will throw InvalidOperationException.

See also

Reference

SPManagedAccount class

SPManagedAccount members

Microsoft.SharePoint.Administration namespace