Partilhar via


How to bypass MySite redirection introduced with the SP2 when you display user details?

SharePoint SP2 has introduced the systematic redirection to the MySite when you display the details of a user.

In most scenarios this does not have any impact, but some companies don’t use the MySite and in such a case redirection needs to be deactivated.

Fortunately, it’s very easy to deactivate the redirection by writing a feature that will prevent controls which redirect to be rendered. This can be done using Delegate Controls, which are described in this article.

 

feature.xml :

<?xml version="1.0" encoding="utf-8"?>
<Feature
  Id="6630E84A-F21D-4c9d-BA71-CDB7785E0787"
  Title="Yvand.BypassMysite"
  Description="Display user details in userdisp.aspx page within the site collection, as per pre-SP2 behavior."
  Creator="Yvan Duhamel"
  Version="1.0.0.0"
  Scope="Farm"
  Hidden="FALSE"
  xmlns="https://schemas.microsoft.com/sharepoint/">
  <ElementManifests>
    <ElementManifest Location="MySiteFeatureElements.xml" />
  </ElementManifests>
</Feature>

 

MySiteFeatureElements.xml :

<Elements xmlns="https://schemas.microsoft.com/sharepoint/">
    <Control Id="GlobalSiteLink1" Sequence="50" ControlSrc="" />
    <Control Id="GlobalSiteLink2" Sequence="50" ControlSrc=""/>
    <Control Id="ProfileRedirection" Sequence="50" ControlSrc=""/>
</Elements>

 

Once the feature is installed, it can be activated at farm level (Central Administration > Operations > Manage Farm Features) to immediately deactivate the redirection to MySite.