1
我需要知道我怎么可以从Active Directory检索ZipCode
。目前,我可以得到User
和Department
但我不能检索ZipCode
。如何从SharePoint 2010中的UserProfileManager检索ZipCode?
在docs我看不到ZipCode
作为一个属性:
这是我在C#代码:
using(SPSite site = new SPSite("Server"))
{
site.AllowUnsafeUpdates = true;
SPServiceContext context = SPServiceContext.GetContext(site);
UserProfileManager upm = new UserProfileManager(context);
UserProfile profile = upm.GetUserProfile(GetNodeValue("xPath"));
String department = profile[PropertyConstants.Department].Value.ToString();
String position = profile[PropertyConstants.Title].Value.ToString();
String zipCode = profile[PropertyConstants.?????].Value.ToString();
}