View RSS Feed

jamesb

Customising SharePoint Usage Stats - Part Two Code

Rate this Entry
by , 18th February 2011 at 09:56 AM (1421 Views)
Code:
SPFarm farm = this.Farm;
int intTime;
foreach (SPService service in farm.Services)
{
if (service isSPWebService) {
SPWebService webService = (SPWebService)service; foreach (SPWebApplication webApplication in webService.WebApplications) {
foreach (SPSite site in webApplication.Sites) {
OrganizationProfileManager organizationManager = newOrganizationProfileManager(SPServiceContext.GetContext(site));
OrganizationProfile root = organizationManager.RootOrganization;
foreach (OrganizationProfile organizationProfile in root.GetChildren()) {
if (!(listOrganizations.Contains(organizationProfile))) {listOrganizations.Add(organizationProfile);}
}
}
} foreach (OrganizationProfile organizationProfile in listOrganizations) {
AddOrgPairing(organizationProfile.ID.ToString(), organizationProfile.GetImmediateMembers().ToList<
UserProfile>());
}
}
}

Comments

Trackbacks

Total Trackbacks 0
Trackback URL: