Monday, 18 July 2011

Sharepoint 2010 : Create a mysite for each SharePoint profile (Powershell)

So we have spent an amount of time (hopefully not too much ha) configuring the User profile service and the synchronisation which imports profiles from AD. Our filters are in place so we only have valid profiles.

For the next step we would like to automatically create all the mysites in one hit.

This may or may not be a good idea depending on your exact business requirements but if it is what you want here is a script which will iterate through the profiles and create you a my site for each user.

$site = new-object Microsoft.SharePoint.SPSite("http://mysitehost"); 
$ServiceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($site); 


$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext); 
$AllProfiles = $ProfileManager.GetEnumerator();


foreach($profile in $AllProfiles) 
  
     $profile.CreatePersonalSite();
}


Great fun don't you reckon.

Friday, 15 July 2011

SharePoint 2010 : Managed metadata refinement is missing from Search results

Problem
  • Search service application was indexing correctly
  • Out of the box Search site was returning content correctly as expected
  • Some search refiners were missing. Specifically the ones mapped to Managed metadata and  enterprise keyword columns.
Solution
 
After hunting about for a whole I found the solution which was actually very obvious on reflection but not so obvious when you have a farm sat in front of you.
 
Within the Search Service application, a crawl rule had been created which was set to include some items. There is a setting in there when including items to a specific path as follows:
  • Crawl SharePoint content as http pages
This was checked. After unchecking it and re-crawling the metadata refinement options were presented as expected. Obviously having it checked means that no metadata on documents and the like was being indexed.

As advised. Very simple and obvious. Once you know the solution