Managed Terminal Services::SetTerminalServicesHomeDir

The method sets the Terminal Services Home Directory 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

The user name for which Terminal Services configuration settings are to be changed. If this is a SAM account name, the configuration is set on 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 set in Active Directory, and the preferredDomainController parameter is required.

homeDirectory

Yes

The path of the user's home directory for terminal server logon. This string can specify a local path or a UNC(Universal Naming Convention) path.

homeDirectoryUNC

Yes

A UNC path to the user's home 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\homeDirs\userA", the directory "\\serverX\shareY\homeDirs" must already exist.

<server>

No

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

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="SetTerminalServicesHomeDir"> 
      <executeData> 
        <user>CN=Mary Customer,OU=Hosting,DC=Fabrikam,DC=com</user> 
        <preferredDomainController>dc1</preferredDomainController> 
        <homeDirectory>c:\users\Mary.Customer</homeDirectory> 
        <homeDirectoryUNC>\\ts01\homedirs\Mary.Customer</homeDirectoryUNC> 
      </executeData> 
    </execute> 
  </procedure> 
</request> 

Applies To

Terminal Services Namespace

See also

Tasks

Managed Terminal Services::SetTerminalServicesHomeDirDrive
Managed Terminal Services::SetTerminalServicesProfilePath