MOSS2007 ProfiloUtente Proprietà: accesso programmatico a “attributo mappato” in AD
-
29-09-2019 - |
Domanda
Come forse sapete, MOSS 2007 funzionalità offerte per sincronizzare proprietà di Active Directory a SharePoint Proprietà UserProfile. È possibile mappare proprietà annuncio alle proprietà userprofile a Servizi Condivisi> Profilo utente e Proprietà> Visualizzazione delle proprietà di profilo (tutta la strada in fondo).
Al momento sto indagando la possibilità di modifiche Sincronizza UserProfiles Torna annuncio.
Sono nuovo di SharePoint e lottando la mia strada attraverso la sua API, ma quello che ho scavato fino ad oggi, è che si può iterare per UserProfile modifiche e scoprire timestamp, vecchi valori, nuovi valori, ecc.
string siteUrl = @"http://[siteUrl]/";
Microsoft.SharePoint.SPSite spsite = new Microsoft.SharePoint.SPSite(url);
Microsoft.Office.Server.ServerContext serverContext = Microsoft.Office.Server.ServerContext.GetContext(spsite);
Microsoft.Office.Server.UserProfiles.UserProfileManager userProfileMgr = new Microsoft.Office.Server.UserProfiles.UserProfileManager(serverContext);
var collection = userProfileMgr.GetChanges();
List<ProfilePropertyChange> changes = new List<ProfilePropertyChange>();
foreach (Microsoft.Office.Server.UserProfiles.UserProfileChange change in collection)
{
if (change.ObjectType == Microsoft.Office.Server.UserProfiles.ObjectTypes.SingleValueProperty)
{
var singleValue = change as Microsoft.Office.Server.UserProfiles.UserProfileSingleValueChange;
string oldValue = singleValue.OldValue;
string newValue = singleValue.NewValue;
var profileProperty = singleValue.ProfileProperty;
DateTime modificationDate = singleValue.EventTime;
...
}
}
Tuttavia, quello che sto attualmente in grado di scoprire, è l'accesso programmatico al cosiddetto "attributo mappato" (il nome della proprietà originale in AD).
Qualcuno può punto me l'API di SharePoint che Reveale queste informazioni per me?
Molte grazie
Soluzione
Steve Curran è stato così gentile da rispondere alla mia domanda sul forum di MSDN:
Uso della PropertyMapCollection voi può essere in grado di cercare l'AD mappato attributo dato il nome Userprofile.
DataSource ds = upcm.GetDataSource (); PropertyMapCollection pmc = ds.PropertyMapping;