This documentation is archived and is not being maintained.

DirectorySearcher.ServerTimeLimit Property

Gets or sets the maximum amount of time the server spends searching. If the time limit is reached, only entries found up to that point are returned.

[Visual Basic]
Public Property ServerTimeLimit As TimeSpan
public TimeSpan ServerTimeLimit {get; set;}
public: __property TimeSpan get_ServerTimeLimit();
public: __property void set_ServerTimeLimit(TimeSpan);
public function get ServerTimeLimit() : TimeSpan;
public function set ServerTimeLimit(TimeSpan);

Property Value

A TimeSpan that represents the amount of time that the server should observe in a search. The default of -1 means to use the server-determined default of 120 seconds.


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

Set ServerTimeLimit to a negative value to use the server-determined default.

Note   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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

DirectorySearcher Class | DirectorySearcher Members | System.DirectoryServices Namespace | TimeSpan