EDN Admin
Well-known member
Hi All,
Im not able to get the telephoneNumber property value from the Active directory<br/>
DirectoryEntry entry = new DirectoryEntry(" LDAP://CN=Users,DC=domain,DC=com ");<br/>
DirectorySearcher Dsearch = new DirectorySearcher(entry);<br/>
string Name = "user";<br/>
//Dsearch.Filter = "(&(objectClass=user)(l=" + Name + "))";<br/>
Dsearch.Filter = "(&(objectCategory=User)(samaccountname=" + Name + "))";<br/>
// get all entries from the active directory.<br/>
// Last Name, name, initial, homepostaladdress, title, company etc..<br/>
SearchResult sResultSet = Dsearch.FindOne();
sResultSet.Properties[" telephoneNumber "][0].ToString() ;
Im able to get other properties , is it required any permissions from Active directory for getting the phone number.
REgards,
Muqeem <hr class="sig Muqeem
View the full article
Im not able to get the telephoneNumber property value from the Active directory<br/>
DirectoryEntry entry = new DirectoryEntry(" LDAP://CN=Users,DC=domain,DC=com ");<br/>
DirectorySearcher Dsearch = new DirectorySearcher(entry);<br/>
string Name = "user";<br/>
//Dsearch.Filter = "(&(objectClass=user)(l=" + Name + "))";<br/>
Dsearch.Filter = "(&(objectCategory=User)(samaccountname=" + Name + "))";<br/>
// get all entries from the active directory.<br/>
// Last Name, name, initial, homepostaladdress, title, company etc..<br/>
SearchResult sResultSet = Dsearch.FindOne();
sResultSet.Properties[" telephoneNumber "][0].ToString() ;
Im able to get other properties , is it required any permissions from Active directory for getting the phone number.
REgards,
Muqeem <hr class="sig Muqeem
View the full article