Managed Terminal Services::SetDeviceMapping

The method enables or disables local device mapping in Terminal Services sessions for the specified user.

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.

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

<reestablishDriveMappings>

No

It indicates whether the terminal server automatically reestablishes client drive mappings at logon. Valid values are 'true', 'false', '1', and '0'.

<reestablishClientPrinterMappings>

No

It indicates whether the terminal server automatically reestablishes client printer mappings at logon. Valid values are 'true', 'false', '1', and '0'.

<clientPrinterIsDefault >

No

It indicates whether the client printer is the default printer. Valid values are 'true', 'false', '1', and '0'.

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="SetDeviceMapping"> 
      <executeData> 
        <user>CN=Mary Customer,OU=Hosting,DC=Fabrikam,DC=com</user> 
        <preferredDomainController>dc1</preferredDomainController> 
        <reestablishDriveMappings>false</reestablishDriveMappings> 
        <reestablishClientPrinterMappings>true</reestablishClientPrinterMappings> 
        <clientPrinterIsDefault>true</clientPrinterIsDefault> 
      </executeData> 
    </execute> 
  </procedure> 
</request> 

Applies To

Terminal Services Namespace