Directory Services, Søg I alle LDap, IIS, ect. Providers.
Har et lille problem med at få søgning I alle kendte AD services fra en computer, jeg ved der under min bruger er adgang til 2 stk, men når jeg bruger følgende søger den kun igennem mit primary catalog:/// <summary>
/// Finds the user group.
/// </summary>
/// <param name="group">The group.</param>
/// <returns></returns>
public string FindUserGroup(string group)
{
//Search local computer
using (DirectorySearcher searcher = new DirectorySearcher(new DirectoryEntry()))
{
searcher.Filter = "(&(objectClass=group)(|(cn=" + group + ")(dn=" + group + ")))";
SearchResult result = searcher.FindOne();
if (result != null)
return TranslateDirectoryEntryPath(result.GetDirectoryEntry().Path);
}
//Search current forest
Forest forest = Forest.GetCurrentForest();
foreach (Domain domain1 in forest.Domains)
{
using (DirectorySearcher searcher = new DirectorySearcher(domain1.GetDirectoryEntry()))
{
searcher.Filter = "(&(objectClass=group)(|(cn=" + group + ")(dn=" + group + ")))";
SearchResult result = searcher.FindOne();
if (result != null)
return TranslateDirectoryEntryPath(result.GetDirectoryEntry().Path);
}
}
return string.Empty;
}
Nogen Ideer, Links eller andet?