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

Does anyone know how to programmatically change the Personal Site field in their SharePoint Profile programmatically? I can do it via the GUI on the SSP server, but that takes an unacceptable amount of clicks for the number we need to do. Using PowerShell, we have accessed the User Profile object, but the properties there are read-only, and cannot be set.

share|improve this question
    
What is your goal -- are you moving the user's My Site? Microsoft.Office.Server.UserProfiles.PersonalSite gets the value, it can't change it. If you're moving the site, you can follow this procedure (or use it as a starting point): blogs.msdn.com/b/webtamer/archive/2008/03/28/… –  shufler Nov 16 '11 at 17:44
    
This is for when a user changes Domains in the company. My Site urls are http://«server»/personal/DN_lanID where DN is a code indicating their Domain. We create them a new My Site under the new name, but for a small amount of time they have both IDs. We want to point the old profile to the new site, so they get to the new site no matter which id they log in with. –  plattitude Nov 18 '11 at 19:25
    
In theory if you do a Move-SPUser (technet.microsoft.com/en-us/library/ff607729.aspx), it will point the new user to the old site. Two issues: 1) Not sure if this will work if the "NewAlias" is a user of the site with its own My Site and 2) The old My Site URL will persist and may not match the user's new credentials (DOMAIN or USERNAME could be different) –  shufler Nov 18 '11 at 19:39
    
«Sigh» Once again I wish I were supporting SharePoint 2010. Alas, my company is perpetually 8 months away from moving to that land of blissful powershell cmdlets... :) –  plattitude Nov 18 '11 at 21:11
    
Oh Jeez, it's right there in the title. Sorry. stsadm -o migrateuser technet.microsoft.com/en-us/library/cc262141(v=office.12).aspx –  shufler Nov 18 '11 at 21:21
add comment

1 Answer 1

up vote 2 down vote accepted

Inspired by a recent xkcd, I'm posting the answer I found for future users.

After getting the user profile object into $user:

$user[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::personalspace].value = "/personal/etc..."

This link has a list of the "PropertyConstants" values that can be set in this manner:
MSDN: PropertyConstants Members

share|improve this answer
    
Thanks for posting the answer! :) –  Kit Menke Nov 21 '11 at 15:17
add comment

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.