TerminalServicesProvider::GetUserConfiguration

The GetUserConfiguration method retrieves a complete list of Terminal Services-related user settings for the specified user from Active Directory or from the specified terminal server. The settings returned are as follows:

  • InitialProgram

  • WorkingDirectory

  • fAllowLogonTerminalServer

  • TimeoutSettingsConnections

  • TimeoutSettingsDisconnections

  • TimeoutSettingsIdle

  • fDeviceClientDrives

  • fDeviceClientPrinters

  • fDeviceClientDefaultPrinter

  • BrokenTimeoutSettings

  • ReconnectSettings

  • ModemCallbackSettings

  • ModemCallbackPhoneNumber

  • ShadowingSettings

  • TerminalServerProfilePath

  • TerminalServerHomeDir

  • TerminalServerHomeDirDrive

  • fTerminalServerRemoteHomeDir

Arguments

Input Arguments Required Description

<user>

Yes

The user name (SAM account name) for which Terminal Services configuration settings are to be retrieved.

<server>

Yes

Name of the domain controller or terminal server from which settings are to be retrieved. If a domain controller is specified, settings for a domain user are retrieved from Active Directory via the specified DC. If a terminal server is specified, settings for a local user on that server are retrieved.

Dd252241.note(en-us,TechNet.10).gifNote
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.

Output Arguments

The configuration data (names listed above) is returned as child <property> elements within an element called <properties>.

Remarks

Rollback

Not applicable

Underlying API

WTSQueryUserConfig

Sample Code

Example XML Request

<request> 
  <procedure> 
    <execute namespace="Terminal Services Provider" procedure="GetUserConfiguration"> 
      <executeData> 
        <server>PreferredDomainController</server> 
        <user>UserA</user> 
      </executeData> 
    </execute> 
  </procedure> 
</request> 

Example XML Response

<response> 
  <executeData> 
    <server>PreferredDomainController</server> 
    <user>UserA</user> 
    <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> 
      <property name="fTerminalServerRemoteHomeDir">false</property> 
    </properties> 
  </executeData> 
</response> 

Applies To

Terminal Services Provider

See also

Tasks

TerminalServicesProvider::SetUserConfiguration