0

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

1
  • 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
    Commented Apr 25, 2014 at 17:52

2 Answers 2

1

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

0
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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