Skip to content

Instantly share code, notes, and snippets.

@ragnard
Created November 29, 2010 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ragnard/720541 to your computer and use it in GitHub Desktop.
Save ragnard/720541 to your computer and use it in GitHub Desktop.
Attribute Scoped Queries made easier.
public class Group
{
[DirectoryAttribute("member")]
public IList<string> Members { get; set; }
}
public class User
{
[DirectoryAttribute("objectGUID")]
public Guid ObjectGUID { get; set; }
[DirectoryAttribute("sAMAccountName")]
public string SamAccountName { get; set; }
}
var members = Session.Search<Group, User>("CN=Domain Users,CN=Users,DC=example,DC=com", g => g.Members, "(objectClass=*)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment