Managed Terminal Services::SetTerminalServicesProfilePath

The method sets the Terminal Services Profile Path for the specified user. The method creates the folder if it does not exist, but does not fail if the folder already exists.

Arguments

Input Arguments Required Description

<user>

Yes

Required input. The user name for which Terminal Services configuration settings are to be changed. If this is a SAM account name, the configuration is retrieved from the specified server, and server parameter is required. If this is a distinguished name (DN) or an LDAP(Lightweight Directory Access Protocol) path, the configuration is retrieved from Active Directory, and the preferredDomainController parameter is required.

profilePath

Yes

Required input. The path of the user's profile for terminal server logon path.

profilePathUNC

Yes

Required input. A UNC path to the user's profile directory. This is used by the namespace code to create the folder. Note that the immediate parent directory of the directory to be created must already exist; if it does not, this method will fail. For example, if this parameter is "\\serverX\shareY\profiles\userA", the directory "\\serverX\shareY\profiles" must already exist.

<server>

No

Optional input. The name of the terminal server on which settings are to be changed. This parameter is required if user is specified as a SAM account name. This parameter is ignored if user is specified as a DN or LDAP path. Note: In some configurations an error will occur if this parameter is specified as a fully-qualified name. Use the NetBIOS name instead to avoid the issue.

<preferredDomainController>

No

Optional input. The name of the preferred domain controller on which Active Directory settings are to be changed. This parameter is required if user is specified as a DN or LDAP path. This parameter is ignored if user is specified as a SAM account name. Note: In some configurations an error will occur if this parameter is specified as a fully-qualified name. Use the NetBIOS name instead to avoid the issue.

Remarks

Security

If the inputs specify an Active Directory user, the caller must be a DomainAdmin or OrgCreator. OrgCreators are allowed to change these settings only for users in their organizations.

If the inputs specify a local machine user, the caller must be a domain user who is an administrator of the specified server.

Sample Code

Example XML Request

<request> 
  <procedure> 
    <execute namespace="Managed Terminal Services" 
             procedure="SetTerminalServicesProfilePath"> 
      <executeData> 
        <user>CN=Mary Customer,OU=Hosting,DC=Fabrikam,DC=com</user> 
        <preferredDomainController>dc1</preferredDomainController> 
        <profilePath>c:\documents and settings\Mary.Customer</profilePath> 
        <profilePathUNC>\\ts01\profiles\Mary.Customer</profilePathUNC> 
      </executeData> 
    </execute> 
  </procedure> 
</request> 

Applies To

Terminal Services Namespace

See also

Tasks

Managed Terminal Services::SetTerminalServicesHomeDir
Managed Terminal Services::SetTerminalServicesHomeDirDrive