Answer the question
In order to leave comments, you need to log in
[C#] When trying to work with Active Directory, for any action, an error occurs (inside). How to fix?
Error: System.Runtime.InteropServices.COMException (0x8007054B): The specified domain does not exist or cannot be contacted.
From the administrator launched, gave the rights, all the same gives this exception. Windows 8.1
Answer the question
In order to leave comments, you need to log in
DirectorySearcher specified ?
For example:
var searchRoot = new DirectoryEntry(@"LDAP://DC=subdom,DC=ourdomain,DC=com", @"domain\iis-appPool-username", "password");
searchRoot.AuthenticationType = AuthenticationTypes.ReadonlyServer;
using (var searcher = new DirectorySearcher(searchRoot)) // Specify the search root here
{
searcher.Filter = string.Format("(&(objectClass=group)(sAMAccountName={0}))", "someGroupName");
searcher.PropertiesToLoad.Add("distinguishedName");
var result = searcher.FindOne();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question