harbar.net component based software & platform hygiene

It’s all about relevance. The *-SPProfileLeader Windows PowerShell cmdlets in SharePoint Server 2010 SP1

posted @ Wednesday, July 06, 2011 12:03 PM | Feedback (4)

You may have noticed a few new Windows PowerShell cmdlets included with SharePoint Server 2010 Service Pack 1 (SP1), Get-SPProfileLeader, Add-SPProfileLeader & Remove-SPProfileLeader. These cmdlets are causing a little bit of confusion, so this short post explains them and the problem they are intended to address.

First up, they have absolutely nothing whatsoever to do with Organizational Profiles. The term “leader” here is somewhat misleading (no pun intended!).

What this is all about is User Profiles and People Search Relevance.

One of the key pieces of data that SharePoint Server Search uses to drive relevance in people search results is the user profile property Manager. This is sensible, social distance etc are great ways to deliver highly relevant search results. However, it all relies upon the quality of data. The old adage, “rubbish in, rubbish out”, was never more relevant.

The problem with the Manager property is that in most cases it will be coming from Active Directory via the User Profile Synchronization service. And this is where the problem lies. In most organizations, the Manager attribute in AD exhibits very poor data quality. It’s either out of date, or wrong. But more often than not it’s empty. If all your users have no manager, there is no way for people search to distinguish between company leaders, and everyone else.

The ideal implementation is that only the company leaders would have an empty (null) Manager attribute and therefore Manager user profile property, and everyone else would have correct and up to date managers. Telling customers that in order to improve people search relevancy there needs to be an exercise to fix up AD after the deployment of SharePoint is, as one of my good buddies says, a dog that won’t hunt.

And this is where these two new cmdlets come into play. In SP1 we can now specify the actual leaders of the company directly, regardless of the state of the AD attribute. This corrects the relevancy problem.



Unsurprisingly, this bad boy adds a leader. It checks to see if the account name specified exists (in the profile db). Then it checks the Manager profile property. If there is a manager, it will bail with an error. If there is no manager, it will write a row to a table someplace which identifies that user as a company leader.

$upaProxy = Get-SPServiceApplicationProxy 7643a5c2-a6ae-49eb-8ba0-de2f32a890ba

Add-SPProfileLeader -ProfileServiceApplicationProxy $upaProxy -Name "contoso\davism"
Add-SPProfileLeader -ProfileServiceApplicationProxy $upaProxy -Name "contoso\jonesq"

Get-SPProfileLeader -ProfileServiceApplicationProxy $upaProxy
Failed. User 'contoso\davism' has a manager.
User 'contoso\jonesq' added as a leader.

Once you’ve added a leader with Add-SPProfileLeader, you will need to perform a full crawl of your content sources for the changes to take effect.



Yup, you’ve guessed it. This guy returns the current leaders so you can verify it worked or see who they are.

Get-SPProfileLeader -ProfileServiceApplicationProxy $upaProxy

AccountName                                                   Valid ManagerAccountName                                      ReportCount
-----------                                                   ----- ------------------                                      -----------
contoso\jonesq                                                 True                                                                   0



Removes (or RIFs if you will :)) a leader.

Remove-SPProfileLeader -ProfileServiceApplicationProxy $upaProxy -Name "contoso\jonesq"
User 'contoso\jonesq' removed as a leader.


So there you go. A nice easy way to ensure that your CEO’s pages are high up the search results page in People Search.


Changes to Social Computing features in SharePoint Server 2010 Service Pack 1

posted @ Wednesday, July 06, 2011 10:42 AM | Feedback (0)

One of the best new feature areas of SharePoint Server 2010 was the social computing capabilities delivered by the User Profile Service (UPA). Tags, Ratings, Activities as well as enhancements to the My Sites infrastructure allow enterprises to deliver rich “social” applications with the out of the box capabilities. Furthermore by using these features as building blocks a new class of composite social applications have become possible, enabling the enterprise to leverage social computing for both business benefit and end user happiness.

Of course, as with many aspects of SharePoint 2010, with great power comes the need for responsibility and appropriate planning. Some folks even call this stuff “governance”. Whilst the social computing features were exciting, carnage can quickly occur in your farm if you stick with all the default settings and controls.

With Service Pack 1 (SP1), Microsoft has refined the social computing features significantly. Whilst there are no whizz bang new things, a number of changes have been made which improve the overall operational service management of social data. This post takes a look at these changes.


1. Performance improvements to Social Data related processing

Not anything you can see (and certainly no Silverlight involved :)) but SP1 brings considerable performance improvements to social data related processing. Timer Jobs, and in particular, Activity Feed processing are measurably quicker and hog less resources than before SP1.


2. Activity Feed Timer Job is now enabled by default

Mainly due to privacy concerns (but also performance) in RTM, the Activity Feed Timer Job was disabled by default. This default led to many complaints such as “the activity feeds aren’t working” and “why isn’t such and such an activity showing up on my newsfeed”. Even though there is a Health Analyzer Rule Definition (named ‘Verify that the Activity Feed Timer Job is enabled’) many administrators simply overlooked the configuration of the timer job, thus missing activities for end users.

With SP1 the Activity Feed job is enabled by default. However this doesn’t mean that all hell will break loose! The Setup My Sites page of the UPA now includes the ability to enable or disable the newsfeed on My Sites:


This option is disabled (unchecked) by default. The My Newsfeed link remains in the top navigation of the My Site host, as does the display of the feed itself and the ATOM feed. (which will include changes to profile related activities (e.g. Manager change) but not social data related activities). Unfortunately this setting does not impact the Newsfeed settings page, which in reality is simply the last section of the Edit Profile page.

If you want to play around with this setting and toggle it on and off to see the behaviour, our old buddy IISRESET is needed after changing the setting (and don’t forget to run the timer jobs!).

OK, the ability for administrators to opt in or opt out of newsfeeds, but wouldn’t it be cool if you could do this based upon some value, such as group membership? Yup, but remember this is just a service pack. It is worth noting however that as this is a My Site setting, if you are in a partitioned UPA then this setting is configured on a per tenant basis.


3. Organization Browser fixes

The natty Silverlight Organization Browser is very sweet, especially when profiles are richly populated. However there were some user interface problems with this guy. If you used the browser back/forward buttons and then returned to the page which hosts the organization browser, the selected person was lost. Also if you attempted to host the organization browser in a different web app to that hosting the My Site host nasty authentication prompts would occur and sometimes it just plain didn’t work. Both of these issues have been fixed. Yay!


4. Customized Security Trimming

In RTM, there was no ability to change the behaviour of the Social Security Trimmer. Now we have three options.

1. Check all links for permissions
The same behaviour as RTM. Everything is checked, which of course incurs a penalty.

2. Check only specified links for permission
New. We can specify a list of URLs (one per line) for which we wish to perform permission checks.
We can also specify a list of URLs to display regardless of permissions. This is *really* nice, and allows us to specify when and when not to perform security trimming, in the example below we will do trimming on stuff under the corporate intranet, but not within the ‘socialcorp’ where all the fun stuff happens!

3. Show all links regardless of permission
New. Effectively turn off security trimming entirely.




5. Default Secondary My Site Owner

With RTM, the My Site Cleanup job would attempt to set the secondary site collection administrator when a user was deleted from the Profile DB. It would use the user’s manager. However if there is no manager, this operation would fail. Now we can specify a default secondary site collection administrator to be used by the My Site Cleanup job if the manager property is empty. Nice!



6. Manage Social Tags and Notes

A very small change that has a lot of value, this page now allows searching based on only one parameter, rather than at least two, as with RTM


7. The Move-SPSocialComments Windows PowerShell cmdlet

This is very handy indeed. It will take social comments (Noteboard entries) from one page and move them to another page. It does not move Tags or Ratings. This is very valuable for migration scenarios.

At the end of the day, this guy is updating the URL for each comment, and ensuring the new URL is in the table of URLs.

This is a Windows PowerShell wrapper for a new method, MergeSocialNotes of the SocialDataManager abstract class in Microsoft.Office.Server.SocialData.

Here’s how you use the cmdlet:

# Use Get-SPServiceApplicationProxy to find the UPA proxy identifier
$upaProxy = Get-SPServiceApplicationProxy 7643a5c2-a6ae-49eb-8ba0-de2f32a890ba

Move-SPSocialComments -ProfileServiceApplicationProxy $upaProxy '
	-OldUrl "http://consps/Pages/mergetest.aspx" '
	-NewUrl "http://consps/Pages/desttest.aspx"




There you have it. A brief round up of the interesting changes in social computing in SharePoint Server 2010 Service Pack 1. These improvements make it far easier to manage, and dare I say it, govern social data within the enterprise. Whilst the changes are small they will make a huge difference in terms of the operational service management cost of social implementations. It’s also a great example of how the SharePoint product group are listening to customers to deliver incremental improvements to this exciting feature capability.