This command replaces the gl-setmysitesnamingformat command as it includes the same functionality along with additional capabilities.
I had originally created the gl-setmysitesnamingformat command to address a need to set the naming format of personal sites and I originally didn't think I'd have to worry about the other settings on the My Sites Settings page but turns out that I did need to set one other field. So rather than create another command for just one field I decided to create a command that would allow me to set any value on that particular page.
I was originally thinking I would exclude the naming format as I already had a command for that but then decided that I'd just include it so that this command became a one-stop-shop and the other could be deprecated (I'll leave it in but there's not much need for it now that this command exists).
Like the original command I had to use reflection to set the internal properties (I just don't understand why Microsoft chose not to make the UserProfileApplication object public). Beyond using the internal UserProfileApplication class the command also uses an internal method called CommitPersonalSiteSettings which is part of the UserProfileManager class (I had to use reflection to call this method but at least I'm not accessing the database directly).
I'm hoping that Microsoft will either make these methods and objects public or will create the ability to set these values via the existing properties. The core code is shown below (if using reflection scares you I'd suggest clicking away):The syntax of the command I created to set the various properties can be seen below.
C:\>stsadm -help gl-mysitesettings stsadm -o gl-mysitesettings Sets the my site settings for the My Sites web application. Parameters: -sspname <SSP name> [-nameformat <Username_CollisionError | Username_CollisionDomain | Domain_Username>] [-location <personal site location>] [-chooselanguage <enable | disable>] [-readers <comma separated list of site group readers>] [-searchcenter <preferred search center URL>] [-remotemysites <enable | disable>] [-provider <personal site provider URL (ex: "http://mysites")>]
Here’s an example of how to set all the properties:
Please note that because this command uses internal only classes and methods directly it could, according to Microsoft, put your environment into an un-supported state (though this is Microsoft's recommended approach over directly manipulating the database). Please make sure you understand what the command is doing and what your support options with Microsoft are.
stsadm -o gl-mysitesettings -sspname "SSP1" -nameformat username_collisiondomain -location "personal" -chooselanguage disable -readers "NT AUTHORITY\authenticated users" -searchcenter "http://intranet/searchcenter/pages" -remotemysites disable -provider "http://mysites"