You want to use Win32::Lanman (get the latest version: v1.09).
>From my (yet to be published second edition of TSE), pay close attention to
the WTSUserConfigfAllowLogonTerminalServer property:

Configuring user accounts to use Terminal Services
--------------------------------------------------
Each user can be configured to have specific Terminal Server options. This
is done with the WTSQueryUserConfig() and WTSSetUserConfig() functions:

  Win32::Lanman::WTSQueryUserConfig( $Server, $User, \@Properties, \%Config
);
  Win32::Lanman::WTSSetUserConfig( $Server, $User, \%Config )

The $Server parameter is the name of either a domain or a Terminal Server.
If this is undef or an empty string then the function will use the current
machine which the script is running on.
The $User parameter is the name of the user account that is to be used.
The \@Properties parameter is a reference to an array. Populate this array
with any of the values in Table 2.12.

The \%Config parameter is a reference to a hash. Populate this hash with the
values you want to modify. Each hash key identifies the property value by
name. The name is determined by removing the "WTSUserConfig" from its
related setting constant name (refer to Table 2.12), then convert the
remaining string to lowercase. For example the key for the
WTSUserConfigInitialProgram setting would be "initialprogram". And the key
for the WTSUserConfigfAllowLogonTerminalServer setting would be
"fallowlogonterminalserver".

If these functions are successful they return TRUE (1), otherwise they
return FALSE (0).

Table 2.12[em]Terminal Server settings for user accounts
WTSUserConfigInitialProgram     Path to an application that will run when
the user logs onto a Terminal Server. The path is relative to the Terminal
Server which the user logs onto.

WTSUserConfigWorkingDirectory   This is the default directory that is used
when running the application specified in the WTSUserConfigInitialProgram
property.

WTSUserConfigfInheritInitialProgram     This is a Boolean value that
indicates whether the client can specify the initial program
(WTSUserConfigInitialProgram).
A 0 value indicates that the user can not specify the initial program. If an
initial program is configured then only that program may run. When the
program terminates then the user is forced to logoff.
A 1 value indicats that the user can specify the initial program.

WTSUserConfigfAllowLogonTerminalServer  This is a Boolean value that
indicates whether the user is allowed to logon to a Terminal Server.

WTSUserConfigTimeoutSettingsConnections This is the maximum time (in
milliseconds) that the user can remain logged onto a Terminal Server. The
user is alerted to the pending timeout one minute before it occurs.
Once time expires the user is either disconnected or terminated, depending
upon the 

WTSUserConfigBrokenTimeoutSettings setting. Every time the user logs on the
timer is reset. 
A value of 0 means that there is no timeout imposed.

WTSUserConfigTimeoutSettingsDisconnections      Amount of time (in
milliseconds) that a disconnected session is allowed to exist before it is
terminated. A value of 0 means that a disconnected session can remain
indefinitely.

WTSUserConfigTimeoutSettingsIdle        Amount of time (in milliseconds)
that a session is allowed be idle (no keyboard or mouse input). Once this
time has been exceeded the session is either disconnected or terminated
depending upon the value of the WTSUserConfigBrokenTimeoutSettings setting.
A value of 0 means that a session can remain idle indefinitely.
WTSUserConfigfDeviceClientDrives        A Boolean value indicating whether
the terminal server automatically reestablishes client drive mappings at
logon. This applies only to Citrix clients.

WTSUserConfigfDeviceClientPrinters      A Boolean value indicating whether
the terminal server automatically reestablishes client printer mappings at
logon. This applies only to Citrix clients.

WTSUserConfigfDeviceClientDefaultPrinter        A Boolean value indicating
whether the client printer is the default printer. This applies only to
Citrix clients.

WTSUserConfigBrokenTimeoutSettings      A Boolean value indicating what
happens when the connection or idle timers expire or when a connection is
lost due to a connection error.
Value of 0 will disconnect sessions.
Value of 1 will terminate sessions.

WTSUserConfigReconnectSettings  A Boolean value indicating how disconnected
clients can reconnect.
Value of 0 means a client can reconnect to a session from any machine.
Value of 1 means a client can only reconnect to a session from the remote
machine she originally created the session with. Attempting to reconnect
from a different machine will result in a new logon session.

WTSUserConfigModemCallbackSettings      How a Terminal Server reacts to a
dialup connection. This applies only to Citrix clients.
Value of 0 means callbacks are disabled.
Value of 1 means that the user is prompted for a phone number to call back.
Any value in the 

WTSUserConfigModemCallbackPhoneNumber property will displayed as the default
phone number.
Value of 2 means that the call is disconnected and the server calls the user
back using the phone number specified in the
WTSUserConfigModemCallbackPhoneNumber property.

WTSUserConfigModemCallbackPhoneNumber   Phone number used for dialup
connection callbacks. Refer to the WTSUserConfigModemCallbackSettings
property. This applies only to Citrix clients.

WTSUserConfigShadowingSettings  Determines whether or not the user can be
shadowed. Shadowing allows a user to monitor another user's activity. This
applies only to Citrix clients.
Value of 0 means shadowing is diabled.
Value of 1 means the shadow is allowed input and the user is notified of the
shadow.
Value of 2 means the shadow is allowed to provide input and the user is not
notified of the shadow.
Value of 3 means the shadow is not allowed to provide input and the user is
notified of the shadow.
Value of 4 means the shadow is not allowed to provide input and the user is
not notified of the shadow.
WTSUserConfigTerminalServerProfilePath  The path to the user's profile that
is used during a Terminal Server session. This profile must be created
manually and exist before the logon process.

WTSUserConfigTerminalServerHomeDir      The path to the user's home
directory that is used during a Terminal Server session. This can be either
a local path or a UNC.

WTSUserConfigTerminalServerHomeDirDrive A drive letter which a UNC specified
in the 

WTSUserConfigTerminalServerHomeDir property is mapped to.

WTSUserConfigfTerminalServerRemoteHomeDir       A Boolean value indicating
whether or not the path specified in the WTSUserConfigTerminalServerHomeDir
property is a UNC path (which will be mapped to a drive letter) or a local
directory.
A value of 0 means that the path is a local directory.
A value of 1 means that the path is a UNC and needs to be mapped to the
drive letter specified by the WTSUserConfigTerminalServerHomeDirDrive
property.

Dave Roth
http://www.roth.net/


-----Original Message-----
From: Scott F [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 09, 2001 8:32 AM
To: [EMAIL PROTECTED]; Martin, James S.
Subject: Re: Allow login to Terminal Server


The checkbox is found in Computer Management, Users and Groups, Users 
under the Properties of an individual user there is a Tab for Terminal 
Services Profile, Allow logon to Terminal server.  

I don't know where you would address that via the modules listed below.


On 9 Jul 2001, at 11:14, Martin, James S. wrote:

> There is a checkbox in Win2k on the user manager  for "Allow login to 
> Terminal Server".  Has anyone figured out how to turn this on/off?  I 
> don't see anything for it in AdminMisc, Lanman, or Netadmin modules.
> 

_______________________________________________
Perl-Win32-Admin mailing list [EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to