Sharepoint 2010 grab SIP address from AD?
문제
I would like to have the 'SIP Address' (eg. sip:myname.companyname.com) field automatically filled in so we can use Portal's 'presence' functionality - as far as I can see we have no dedicated LDAP attribute for this information.
I would be very grateful of some advice on how to get this data into SharePoint 2010?
해결책
There is a hidden list called SiteUserInfoList on each web, use it to get sip.
private string GetSipAddress(SPUser user, SPWeb web)
{
web = web ?? SPContext.Current.Web;
var userItem = web.SiteUserInfoList.GetItemById(user.ID);
string sip = string.Empty;
if (userItem != null)
{
var sipAddress = userItem["SipAddress"];
if (sipAddress != null)
{
sip = sipAddress.ToString().Replace("sip:", "");
}
}
return sip;
}
There is a post about it.
다른 팁
Assuming you are using AD and the MS SIP infrastructure (OCS/Lync), you should have an attribute in AD called "msRTCSIP-PrimaryUserAddress". You should be able to map this to any user profile attribute you like during synchronization. I'm a little surprised this wouldn't already be getting mapped to the SIP Address attribute, but I guess that depends on what you have setup.