Managed Terminal Services::SetUserSettings

The method sets Terminal Services-related user settings for the specified user in Active Directory. The request may specify any desired subset of the available settings. The settings not specified in the request are left unchanged.

Arguments

Input Arguments Required Description

<user>

Yes

Required input. The user name for which Terminal Services configuration settings are to be retrieved. 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 set in Active Directory, and the preferredDomainController parameter is required.

<server>

No

Optional input. The name of the terminal server from 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 from 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.

In addition, the method accepts settings to be changed. These are nested inside an <properties> element and are all optional. Refer to the Terminal Services provider specification or to WTS_CONFIG_CLASS on MSDN for more information.

Setting Arguments Setting Arguments

properties/property[@name='InitialProgram']

properties/property[@name='WorkingDirectory']

properties/property[@name='fAllowLogonTerminalServer']

properties/property[@name='TimeoutSettingsConnections']

properties/property[@name='TimeoutSettingsDisconnections']

properties/property[@name='TimeoutSettingsIdle']

properties/property[@name='fDeviceClientDrives']

properties/property[@name='fDeviceClientPrinters']

properties/property[@name='fDeviceClientDefaultPrinter']

properties/property[@name='BrokenTimeoutSettings']

properties/property[@name='ReconnectSettings']

properties/property[@name='ModemCallbackSettings']

properties/property[@name='ModemCallbackPhoneNumber']

properties/property[@name='ShadowingSettings']

properties/property[@name='TerminalServerProfilePath']

properties/property[@name='TerminalServerHomeDir']

Remarks

Security

If the inputs specify an Active Directory user, the caller must be a DomainAdmin, OrgCreator, or OrgAdmin. OrgCreators and OrgAdmins are allowed to change 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="SetUserSettings"> 
      <executeData> 
        <user>CN=Mary Customer,OU=Hosting,DC=Fabrikam,DC=com</user> 
        <preferredDomainController>dc1</preferredDomainController> 
        <properties> 
          <property name="InitialProgram">HelloWorld.exe</property> 
          <property name="WorkingDirectory">c:\simplePrograms</property> 
          <property name="fAllowLogonTerminalServer">true</property> 
          <property name="TimeoutSettingsConnections">0</property> 
          <property name="TimeoutSettingsDisconnections">0</property> 
          <property name="TimeoutSettingsIdle">0</property> 
          <property name="fDeviceClientDrives">false</property> 
          <property name="fDeviceClientPrinters">false</property> 
          <property name="fDeviceClientDefaultPrinter">false</property> 
          <property name="BrokenTimeoutSettings">1</property> 
          <property name="ReconnectSettings">0</property> 
          <property name="ModemCallbackSettings">0</property> 
          <property name="ModemCallbackPhoneNumber"></property> 
          <property name="ShadowingSettings">0</property> 
          <property name="TerminalServerProfilePath">\\DC\TSProfiles</property> 
          <property name="TerminalServerHomeDir">\TSUsers</property> 
          <property name="TerminalServerHomeDirDrive">c:</property> 
          <!-- fTerminalServerRemoteHomeDir is read-only  
               and so is not allowed in SetUserSettings. 
          <property name="fTerminalServerRemoteHomeDir">false</property> 
          --> 
        </properties> 
      </executeData> 
    </execute> 
  </procedure> 
</request> 
 

Applies To

Terminal Services Namespace

See also

Tasks

Managed Terminal Services::GetUserSettings