wntWtsUserGet

Gets user information from an NT Terminal Server. This function requires WTSAPI32.DLL to be present.

Syntax:

wntWtsUserGet( server-name, user-name, request [, input-format-flag])

Parameters:

(s) server-name: the name of a Windows-based Terminal Server or domain controller, or "" to indicate the Terminal Server on which your application is running.

(s) user-name: a user name.

(i) request: specifies the information to get. (see below).

(i) input-format-flag: [optional] controls how the user-name parameter value is interpreted.

Value Meaning
0 (default) user-name of an actual user account name.
1 user-name contains a SID value instead of an actual user account name.

Returns:

(s/i) Returns a string or integer, depending on "request".

 

"request" specifies the information to get, and can be one of the following:

 

Request

 Type

Meaning

1

InitialProgram

(s) path of the initial program that Terminal Server runs when the user logs on.

 

2

WorkingDirectory

(s) path of the user's working directory.

 

3

InheritInitialProgram

(i) flag for inheriting the initial program.

Value Meaning

0 The client cannot specify the initial program. The WTSUserConfigInitialProgram string indicates the initial program. If you specify a user's initial program, that's the only program they can run; Terminal Server logs off the user when the user exits that program.

1 The client can specify the initial program.

 

4

AllowLogonTerminalServer

(i) flag that indicates whether the user account is permitted to log on to a Terminal Server.

Value Meaning

0 The user cannot logon.

1 The user can logon.

 

5

TimeoutSettingsConnections

(i) specifies the maximum connection duration, in milliseconds. One minute (60000 milliseconds) before the connection timeout interval expires, the user is notified of the pending disconnection. The user's session is disconnected or terminated depending on the WTSUserConfigBrokenTimeoutSettings value. Every time the user logs on, the timer is reset. A value of zero indicates the connection timer is disabled.

 

6

TimeoutSettingsDisconnections

(i) specifies the maximum duration, in milliseconds, that a Terminal Server retains a disconnected session before the logon is terminated. A value of zero indicates the disconnection timer is disabled.

 

7

TimeoutSettingsIdle

(i) specifies the maximum idle time, in milliseconds. If there is no keyboard or mouse activity for the specified interval, the user's session is disconnected or terminated depending on the WTSUserConfigBrokenTimeoutSettings value. A value of zero indicates the idle timer is disabled.

 

8

DeviceClientDrives

(i) (Citrix ICA clients only) A flag that indicates whether the Terminal Server automatically reestablishes client drive mappings at logon.

Value Meaning

0 The server does not automatically connect to previously mapped client drives.

1 The server automatically connects to previously mapped client drives at logon.

 

9

DeviceClientPrinters

(i) (RDP 5.0 clients and Citrix ICA clients): A flag that indicates whether the Terminal Server automatically reestablishes client printer mappings at logon.

Value Meaning

0 The server does not automatically connect to previously mapped client printers.

1 The server automatically connects to previously mapped client printers at logon.

 

10

DeviceClientDefaultPrinter

(i) (RDP 5.0 clients and Citrix ICA clients): A flag that indicates whether the client printer is the default printer.

Value Meaning

0 The client printer is not the default printer.

1 The client printer is the default printer.

 

11

BrokenTimeoutSettings

(i) flag that indicates what happens when the connection or idle timers expire or when a connection is lost due to a connection error.

Value Meaning

0 The session is disconnected.

1 The session is terminated.

 

12

ReconnectSettings

(i) flag that indicates how a disconnected session for this user can be reconnected.

Value Meaning

0 The user can log on to any client computer to reconnect to a disconnected session. Note that sessions started at clients other than the system console cannot be connected to the system console, and sessions started at the system console cannot be disconnected.

1 The user can reconnect to a disconnected session by logging on to the client computer used to establish the disconnected session. If the user logs on from a different client computer, the user gets a new logon session.

 

13

ModemCallbackSettings

(i) (Citrix ICA clients only): A value that indicates the configuration for dialup connections in which the Terminal Server hangs up and then calls back the client to establish the connection.

Value Meaning

0 Callback connections are disabled.

1 The server prompts the user to enter a phone number and calls the user back at that phone number. You can use the WTSUserConfigModemCallbackPhoneNumber value to specify a default phone number.

2 The server automatically calls the user back at the phone number specified by the WTSUserConfigModemCallbackPhoneNumber value.

 

14

ModemCallbackPhoneNumber

(s) (Citrix ICA clients only): A string containing the phone number to use for callback connections.

 

15

ShadowingSettings

(i) (RDP 5.0 clients and Citrix ICA clients): A flag that indicates whether the user session can be shadowed. Shadowing allows a user to remotely monitor the on-screen operations of another user.

Value Meaning

0 The session cannot be shadowed. (Disable)

1 The session can be shadowed. Enable input, notify

2 Enable input, no notify

3 Enable no input, notify

4 Enable no input, no notify

 

16

TerminalServerProfilePath

(s) string containing the path of the user's profile for Terminal Server logon.

 

17

TerminalServerHomeDir

(s) string containing the path of the user's home directory for Terminal Server logon. This string can specify a local path or a UNC path (\\machine\share\path). See WTSUserConfigfTerminalServerRemoteHomeDir.

 

18

TerminalServerHomeDirDrive  

(s) string containing a drive letter to which the UNC path specified in the WTSUserConfigTerminalServerHomeDir string is mapped. See WTSUserConfigfTerminalServerRemoteHomeDir.

 

19

TerminalServerRemoteHomeDir

(i) flag that indicates whether the user's home directory for Terminal Server logon is a local path or a mapped drive letter.

Value Meaning

0 The WTSUserConfigTerminalServerHomeDir string contains the local path of the user's Terminal Server logon home directory.

1 The WTSUserConfigTerminalServerHomeDir string contains the UNC path of the user's Terminal Server logon home directory, and the WTSUserConfigTerminalServerHomeDirDrive string contains a drive letter to which the UNC path is mapped.

 

 

Notice: The use of milliseconds,rather than minutes, for the following flags:

TimeoutSettingsConnections, TimeoutSettingsDisconnections, TimeoutSettingsIdle

[1 second = 1000 milliseconds]

[1 minute = 60000 milliseconds]

To convert from milliseconds to minutes, do the following:

mins= milliseconds / 60000

milliseconds=mins * 60000

Example:

; Load Appropriate Extender
AddExtender('wwwnt34i.dll',0,'wwwnt64i.dll')

ProfilePath = wntWtsUserGet("\\WTS1","bob", 16, 0) Message("The path of the user's profile for Terminal Server logon",ProfilePath) Exit
See Also:

wntWtsUserSet