Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am working on a powershell script to update the following user profile property on my SharePoint 2013 enviornment,

  1. Personal Site
  2. Personal Site Capabilities: 0
  3. Feed service provider defined identifier

However I see this property as "Get" property in the User Profile class. We could update this using the Central Admin application.

Any one has done this using PowerShell ?

Any pointers

share|improve this question
    
Have you found an answer yet? I've been looking into the same issue. I'm not sure why SharePoint doesn't re-map these if the mysite already exists. It seems like a pretty significant oversight to me. –  user25397 Apr 25 at 17:52

2 Answers 2

up vote 0 down vote accepted

Here is a handy Powershell script I just used for updating the Personal Capabilities int:

#Set up default variables
#My Site URL
$mySiteUrl = "http://spdomain/my/"

#The part of the picture URL you are trying to find
$currentValue = "0"

#The value that will replace the above
$newValue = "14"

#The internal name for Property
$upAttribute = "SPS-PersonalSiteCapabilities"

#Get site objects and connect to User Profile Manager service
$site = Get-SPSite $mySiteUrl

$context = Get-SPServiceContext $site
$profileManager = New-Object   Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

$profiles = $profileManager.GetEnumerator()

foreach ($userProfile in $profiles)
{
if ($userProfile[$upAttribute].toString() -ne 14 )
 {
  if ($userProfile.AccountName -like "i:0#.f|ldapmember|colbs")
  {
         $newvalue = $userProfile[$upAttribute].toString()
         $newvalue = $newvalue.Replace($currentURLValue, $newURLValue)
         $userProfile[$upAttribute].Value = $newvalue
         $userProfile.Commit()
  }
 }
}

You can remove the AccountName -like condition if you want every account updated. Also, if you want to update other properties besides PersonalSiteCapabilities, here is a link describing each

http://msdn.microsoft.com/en-us/library/office/jj679700(v=office.15).aspx

share|improve this answer
    
thanks for sharing this :) –  Sudhir Kesharwani Apr 28 at 15:53

The way I usually hunt down how to do these things in PowerShell, is to find the page where it is done in UI (usually a page in _LAYOUTS), find out what assembly that contains the codebehind and what methods are involved (lookin PAGE directive), load the assembly into Reflector and see how SharePoint does it.

share|improve this answer

Your Answer

 
discard

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.