Try this... Replace the values for user and active directory group. DirectoryEntry ent = new DirectoryEntry(appSettings.domain, appSettings.user, appSettings.password, AuthenticationTypes.ReadonlyServer); DirectorySearcher srch = new DirectorySearcher(ent, "(CN=" + activeDirectoryGroup + ")"); SearchResult obj = srch.FindOne(); DirectoryEntry dr = new DirectoryEntry(obj.Path, appSettings.user, appSettings.password); foreach (object ob in (IEnumerable)dr.Invoke("members")) { DirectoryEntry obGpEntry = new DirectoryEntry(ob); //Put your code here. }
I didn't get any requirements for the signature