&nbsp;<BR><BR><BR>HI <BR>I am pullings my hairs. <BR>I have been trying this for three days now. <BR>All i want is to read the user name from active directory . <BR>I have tried this code.. <BR><BR>it gives all the bloody information which i don&#039;t need.. <BR>I need the users there in my Domain. <BR>here pugmarks is my domain name.... <BR>I have searched the internet ..please help me out <BR><BR><BR>public string addmyFunction(DirectoryEntry de) <BR> { <BR> TestUsername=TestUsername +"<BR>"+ de.Properties.Contains("sn").ToString(); <BR> return TestUsername ; <BR> } <BR> public string testUsers() <BR> { <BR> string path="LDAP://pugmarks"; <BR> try <BR> { <BR> DirectoryEntry dire = new DirectoryEntry(path); <BR> DirectorySearcher dser= new DirectorySearcher (dire); <BR> dser.Filter="(&(objectCategory=*))"; <BR> <BR> SearchResultCollection src = dser.FindAll(); <BR> <BR> foreach(SearchResult srr in src) <BR> { <BR> addmyFunction(srr.GetDirectoryEntry()); <BR> <BR> } <BR> //TestUsername= src.Properties.PropertyNames.ToString(); <BR> <BR> <BR> <BR> return TestUsername; <BR> } <BR> catch(System.Runtime.InteropServices.COMException) <BR> { <BR> <BR> System.Runtime.InteropServices.COMException exception = new System.Runtime.InteropServices.COMException(); <BR> return exception.ToString(); <BR> <BR> <BR> } <BR> catch(System.NullReferenceException ) <BR> { <BR> System.NullReferenceException exception = new System.NullReferenceException(); <BR> <BR> return exception.ToString(); <BR> } <BR><BR> return TestUsername; <BR> } <BR><BR><BR>Thanks <BR>Gurpreet Singh