Share via


SPUserCollection.Remove method (String)

Removes the user with the specified user name from the collection.

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

Syntax

'Declaration
Public Sub Remove ( _
    loginName As String _
)
'Usage
Dim instance As SPUserCollection
Dim loginName As String

instance.Remove(loginName)
public void Remove(
    string loginName
)

Parameters

  • loginName
    Type: System.String

    A string that contains the user name.

Exceptions

Exception Condition
SPException

The collection is read-only.

UnauthorizedAccessException

The current user is not a site administrator.

ArgumentException

An attempt was made to remove the last administrator for the farm.

See also

Reference

SPUserCollection class

SPUserCollection members

Remove overload

Microsoft.SharePoint namespace