Share via


SPUserCollection Class

The SPUserCollection class represents a collection of SPUser objects.

System.Object

   Microsoft.SharePoint.SPBaseCollection

      Microsoft.SharePoint.SPUserCollection

Public Methods

The following table shows the public methods of the SPUserCollection class and a brief description of each.

Name Description
AddCollection Adds a collection of users to the existing collection based on an array that specifies user information.
GetByEmail Returns the user with the specified e-mail address.
GetByID Returns the user with the specified member ID.
GetCollection Returns the collection of users with the specified user names.
Remove(Int32) Removes the user at the specified index in the collection.
Remove(String) Removes the user with the specified user name from the collection.
RemoveByID Removes the user with the specified member ID from the collection.
RemoveCollection Removes the collection of users represented by a string array that contains their user names.

Public Properties

The following table shows the public properties of the SPUserCollection class, the data type of each property, and a brief description of each.

Name Data Type Description
Count Int32 Gets the number of users in the collection.
Item(Int32) Microsoft.SharePoint.SPUser Gets the user object at the specified index in the collection.
Item(String) Microsoft.SharePoint.SPUser Gets the user object with the specified user name from the collection.
RetrieveAllRoles Boolean Gets or sets a Boolean value that specifies whether to preload the site groups to which every user object in the collection belongs.
SchemaXmlEx String Gets a list schema that specifies fields used to define the collection.
ViewSchemaXmlEx String Gets a schema that describes the default view used to return user information for the collection.
Web Microsoft.SharePoint.SPWeb Gets the parent site for the collection.
Xml String Gets an XML representation of the collection.
XmlEx String Gets the collection in XMLDATA format.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Requirements

Namespace: Microsoft.SharePoint

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security