Click here to Skip to main content
12,943,299 members (75,303 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 27 Jan 2011

Get SIP address from active directory

, 27 Jan 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
SIP address from active directory
The below code will be used to get the SIP address from the active directory. SIP address is commonly used in office communicator server. I have used this code to fetch the SIP address. Based on the SIP address, we have applied provisioning on office communicator server 2007.

 private string GetSIPAddress(string email)
            DirectoryEntry directoryEntry =
                     new DirectoryEntry(ConfigurationManager.AppSettings["LDAPPATH"]);
            string resultValue = "";
            using (HostingEnvironment.Impersonate())
                DirectorySearcher directorySearcher = new DirectorySearcher(directoryEntry);
                directorySearcher.Filter = string.Format("(&(objectClass=user)(objectCategory=user) (mail={0}))", email);
                SearchResult result = directorySearcher.FindOne();
                if (result != null)
                    if (result.Properties["msRTCSIP-PrimaryUserAddress"] != null)
                        resultValue = result.Properties["msRTCSIP-PrimaryUserAddress"][0].ToString();
                        resultValue = "'" + resultValue + "'";
            return resultValue;


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

No Biography provided

You may also be interested in...

Comments and Discussions

GeneralI have formatted your code for you since you seem too busy t... Pin
Henry Minute27-Jan-11 1:59
memberHenry Minute27-Jan-11 1:59 
GeneralPlease format your code Pin
Indivara26-Jan-11 23:12
subeditorIndivara26-Jan-11 23:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170518.1 | Last Updated 27 Jan 2011
Article Copyright 2011 by PankajKLohani
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid