Get user list but ...

Sep 13, 2011 at 12:08 PM

Hello,

Is there a way to get all users from AD but with email, firstname, lastname ?

 

Thanks,

Feb 16, 2012 at 11:18 PM

Yes. You just need to model your you DirectoryEntity for your ADUser like so:

[DirectorySchema("user", typeof(IADsUser))]
public class ADUser : DirectoryEntity
{
	[DirectoryAttribute("givenName")]
	public string FirstName { get; set; }
	
	[DirectoryAttribute("Mail")]
	public string EmailAddress { get; set; }
	
	[DirectoryAttribute("sn")]
	public string LastName { get; set; }
	
}