Posts

Showing posts from July, 2009

Get User Info from Active Directory using LDAP

using log4net; using System.DirectoryServices; public class ADUserInfo { public string ShortName { get ; set ; } public string DisplayName { get ; set ; } public string Email { get ; set ; } } The following method returns ADUser information: [ Serializable ] [ DataObject ( true )] public class ADUtilities { private static readonly ILog log = LogManager .GetLogger( typeof ( ADUtilities )); /// /// Returns UserInfo Object, /// Which contains User Display Name,Email Address /// /// User ShortName public static List ADUserInfo > GetCurrentUserInfo( string _userName) { if ( String .IsNullOrEmpty(_userName)) { log.Error( "UserName is null or Empty for GetCurrentUserInfo[_userName]: " + _userName); return null ; ...