SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My question is the same as the title:

How can I determine programmatically am in MySites?

share|improve this question
up vote 3 down vote accepted

Check the WebTemplate property of the current SPWeb, if it is SPSMSITEHOST#0, it is a MySite host.

You can use Get-SPWebTemplate powershell command in SharePoint 2010 Management Shell to see list of out of the box web templates.

share|improve this answer
thanks for a good hint! – Shkipper Oct 5 '12 at 14:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.