This ended up being one of those simple commands to create that took way to long to figure out how to create. Fortunately though there is an API available for setting this property (unlike most of the profile import related tasks such as the timer jobs). You can set this manually by going here: Shared Services Administration: SSPName > User Profile and Properties > Configure Profile Import. Or you can do the same thing programmatically using UserProfileConfigManager object - you need to get a DataSource object from an instance of the UserProfileConfigManager and then set the value using the SetDefaultImportAccount() method of the DataSource object:
The syntax of the command I created to do this can be seen below.
C:\>stsadm -help gl-setuserprofiledefaultaccessaccount stsadm -o gl-setuserprofiledefaultaccessaccount Sets default access account for user profiles. Parameters: -username <DOMAIN\name> -password <password> [-sspname <name of the SSP>]
The following table summarizes the command and its various parameters:
|Command Name||Availability||Build Date|
|gl-setuserprofiledefaultaccessaccount||MOSS 2007||Released: 8/9/2007
|Parameter Name||Short Form||Required||Description||Example Usage|
|username||u||Yes||The user account name.||-username "domain\name"
|password||p||Yes||The account password.||-password "pa$$w0rd"
|sspname||ssp||No||The name of the SSP for which to set the user profile account. If not specified then the default SSP is used.||-sspname SSP1
Here’s an example of how to set the default access account:
Note that if you intend to use this in a script make sure you are real careful about where you store that script as the password is obviously going to be stored in clear text which isn't a good thing. Also, you'll notice that I use the SSP name instead of the url - you can change the code to use the url but I found that working with the SSP name was more convenient.
stsadm –o gl-setuserprofiledefaultaccessaccount –sspname SSP1 –username "domain\login" -password "password"
Update 8/14/2008: I've made it so that the SSP is now an optional parameter.