我正在尝试连接到不同林中的 Active Directory 域 (W2K8R2 DC)。为此,我将凭据传递到以下 DirectoryEntry 构造函数中:
DirectoryEntry(string path, string username, string password, AuthenticationTypes authenticationType)
Run Code Online (Sandbox Code Playgroud)
这一切都很好。不过,我想做的是以某种方式保留连接,并在对 AD 的所有调用中重复使用它,这样我就不需要重复传递凭据。这有可能吗?
谢谢!