This documentation is archived and is not being maintained.

DirectorySearcher.ServerTimeLimit Property

The ServerTimeLimit property gets or sets a value indicating the maximum amount of time the server spends searching. If the time limit is reached, only entries that are found up to that point are returned.

Namespace: System.DirectoryServices
Assembly: System.DirectoryServices (in system.directoryservices.dll)

public TimeSpan ServerTimeLimit { get; set; }
/** @property */
public TimeSpan get_ServerTimeLimit ()

/** @property */
public void set_ServerTimeLimit (TimeSpan value)

public function get ServerTimeLimit () : TimeSpan

public function set ServerTimeLimit (value : TimeSpan)

Not applicable.

Property Value

A TimeSpan that represents the amount of time that the server should search. The default value is -1 seconds, which means to use the server-determined default of 120 seconds.

The minimum resolution of this property is one second. Fractions of seconds are ignored.

Unlike the ServerPageTimeLimit property, the ServerTimeLimit property indicates the total amount of time that the server will spend on a search. When the time limit is reached, the server stops searching and returns the results that have accumulated up to that point.

Set ServerTimeLimit to -1 second to use the server-determined default.


If you set ServerTimeLimit to a value that is larger than the server-determined default of 120 seconds, the server-determined default is used. After the server time limit is reached, you cannot continue a search from where it left off.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0