title: Query active directory to get a user's roles in .NET
body: <p>I have been using <a href="http://linqtoad.codeplex.com/" rel="noreferrer">Linq to Active Directory</a> a bit but I am finding it difficult to get a list of all roles of which the user is a member. I can retrieve a list of their immediate groups but it isn't recursive.</p>
  
  <p>The reason I am trying to query AD directory is to work around the built-in Role Manager AspNetWindowsTokenRoleProvider which won't let you call Roles.GetRolesForUser(username) unless the username matches the current Windows Identity.</p>