Solved

Identifying My site on SharePoint 2010 & 2013

Posted on 2015-01-13
3
26 Views
Last Modified: 2015-04-26
What is an easy way to determine if someone has a "My site" on Sharepoint 2010 or 2013?
0
Comment
Question by:Lord_Dragon
  • 2
3 Comments
 
LVL 8

Expert Comment

by:Jayaraja Jayaraman
ID: 40546658
create a console app with the following code and this will show you the list of users that has my site
Display Users that have a MySite

//Get the site associated with the users
using (SPSite spSite = new SPSite(@http://localhost))
{
   //Create the server context because you are in a console application
   ServerContext siteContext = ServerContext.GetContext(spSite);
   UserProfileManager pmManager = new UserProfileManager(siteContext);
   foreach (UserProfile spUser in pmManager)
   {
      if (spUser.PersonalSite != null)
      {
         using(SPSite personalSite = spUser.PersonalSite)
         {
            //Use SPSite like a normal site
            Console.WriteLine("personalSite.Url: " + personalSite.Url);
          }
      }
   }
}
0
 

Accepted Solution

by:
Lord_Dragon earned 0 total points
ID: 40561910
Is there an OTB or Out of teh Box way of doing this? I need a non code solution. thank you.
0
 

Author Closing Comment

by:Lord_Dragon
ID: 40744667
Need an OTB solution but the help is greatly appreciated.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question