ActiveDirectoryMembershipProvider.EnableSearchMethods Property
Gets a value indicating whether search-oriented ActiveDirectoryMembershipProvider methods are available.
Assembly: System.Web (in System.Web.dll)
| Exception | Condition |
|---|---|
| InvalidOperationException | An attempt to access the EnableSearchMethods property was made before the ActiveDirectoryMembershipProvider instance was initialized. |
Because searching an Active Directory server is potentially resource intensive, the EnableSearchMethods property enables you to turn off search-oriented ActiveDirectoryMembershipProvider methods. The EnableSearchMethods property is set in your application's configuration file using the enableSearchMethods attribute of the membership Element (ASP.NET Settings Schema) element.
When the EnableSearchMethods property is false, the following methods are not available:
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.
The following code example shows a Web.config entry that configures an ActiveDirectoryMembershipProvider instance to enable searching an Active Directory server.
<configuration>
<connectionStrings>
<add name="ADService" connectionString="LDAP://ldapServer/" />
</connectionStrings>
<system.web>
<membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
<providers>
<add name="AspNetActiveDirectoryMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.3600, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
enableSearchMethods="true" />
</providers>
</membership>
</system.web>
</configuration>
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.