Having trouble with an unstable VPN connection? Try to keep it alive or troubleshoot by opening a command prompt and doing a “ping –t ipnumber” when connected over VPN. This will keep sending pings until you use Ctrl+C to end the loop, this way keeping the connection alive.
Symptoms: When using .NET Framework System.DirectoryServices hosted in an WCF or Web Services the first LDAP query is really slow but the following are fast. Then, after beeing idle for 15 seconds or more the following LDAP query is really slow again. The queries work, the only problem is the initial overhead when creating a connection to the LDAP server. And after 15 seconds the WCF thread pool recycles.
Cause: The issue could be caused by a mismatch in server certificate if your not calling from the same domain.
Resolution: Use System.DirectoryServices.Protocol instead in order to ignore certificate errors and turn off ReferralChasing.