ActiveDirectoryMembershipProvider.GetAllUsers(Int32, Int32, Int32) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a collection of all the users stored in an Active Directory data source.
public:
override System::Web::Security::MembershipUserCollection ^ GetAllUsers(int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public override System.Web.Security.MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords);
override this.GetAllUsers : int * int * int -> System.Web.Security.MembershipUserCollection
Public Overrides Function GetAllUsers (pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As MembershipUserCollection
- pageIndex
- Int32
The index of the page of results to return. pageIndex
is zero-based.
- pageSize
- Int32
The size of the page of results to return.
- totalRecords
- Int32
When this method returns, contains the total number of records returned in the collection. This parameter is passed uninitialized.
A MembershipUserCollection containing pageSize
MembershipUser instances beginning at the page specified by pageIndex
.
The GetAllUsers(Int32, Int32, Int32) method is called before the ActiveDirectoryMembershipProvider instance is initialized.
pageIndex
is less than 0.
-or
pageSize
is less than 1.
-or-
pageSize
multiplied by pageIndex
, plus pageSize
, minus 1 is greater than Int32.MaxValue.
The EnableSearchMethods property is false
.
This method is called by the Membership class to retrieve user information from the Active Directory data store specified in the ASP.NET application's configuration file.
The results returned by the GetAllUsers method are constrained by the pageIndex
and pageSize
parameters. The pageSize
parameter specifies the maximum number of MembershipUser instances to return in the MembershipUserCollection collection. The pageIndex
parameter specifies which page of results to return, where 0 (zero) indicates the first page.
The totalRecords
parameter is an out
parameter that is set to the total number of matching membership users found in the Active Directory data store. For example, if there are 13 users for the configured data store, and the pageIndex
value was 1 with la pageSize
of 5, the MembershipUserCollection returned would contain the sixth through the tenth users. The totalRecords
parameter would be set to 13.
You can control whether to allow searching for users by setting the EnableSearchMethods property in the application's configuration file using the enableSearchMethods
attribute of the membership Element (ASP.NET Settings Schema) element. Setting the EnableSearchMethods property to false
causes the GetAllUsers method to throw a NotSupportedException exception.
The provider uses a subtree search starting at the search point specified in the connection string. See the ActiveDirectoryMembershipProvider class topic for more information about connection strings.
We recommend that you do not enable searching on production systems until you have confirmed that the search queries issued by the ActiveDirectoryMembershipProvider class do not adversely impact your directory server's performance. Since the ActiveDirectoryMembershipProvider class is designed for a stateless Web environment, it is unable to use the paging optimizations exposed by the underlying System.DirectoryServices APIs. This means that paging operations during searches against large directories are very expensive and should be avoided. Search operations are always issued against the directory server configured in the connection string, or an automatically selected server in the case of a connection string pointing at a domain. The provider does not use a global catalog for its search methods.
מוצר | גירסאות |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
משוב של .NET
.NET הוא פרויקט קוד פתוח. בחר קישור כדי לספק משוב: