Managed Terminal Services::SetTerminalServicesHomeDirDrive

For the specified user, the method sets the drive letter the Terminal Service Home Directory is going to be mapped to and sets the fTerminalServerRemoteHomeDir value to 1. The method also validates that TerminalServerHomeDir is a Universal Naming Convention (UNC) path.

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.

driveLetter

Yes

A string of the form "d:", where d may be any letter from D to Z inclusive. path.

<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.

This method returns the values of the TerminalServerHomeDir, TerminalServerHomeDirDrive, and fTerminalServerRemoteHomeDir user settings. See the Sample Response.

Remarks

Security

If the inputs specify an Active Directory user, the caller must be a DomainAdmin or OrgCreator. OrgCreators are allowed to change this setting 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="SetTerminalServicesHomeDirDrive"> 
      <executeData> 
        <user>CN=Mary Customer,OU=Hosting,DC=Fabrikam,DC=com</user> 
        <preferredDomainController>dc1</preferredDomainController> 
        <driveLetter>Q:</driveLetter> 
      </executeData> 
    </execute> 
  </procedure> 
</request> 

Example XML Response

<response> 
  <executeData> 
    <user>CN=Mary Customer,OU=Hosting,DC=Fabrikam,DC=com</user> 
    <preferredDomainController>dc1</preferredDomainController> 
    <properties> 
      <property name='TerminalServerHomeDir'>\\folderserv01\homedirs\Mary.Customer 
      </property> 
      <property name='TerminalServerHomeDirDrive'>q:</property> 
      <property name='fTerminalServerRemoteHomeDir'>true</property> 
    </properties> 
  </executeData> 
</response> 

Applies To

Terminal Services Namespace

See also

Tasks

Managed Terminal Services::SetTerminalServicesHomeDir
Managed Terminal Services::SetTerminalServicesProfilePath