[THIN] Re: VBscript for checking User Manager settings

  • From: Jim Kenzig <jimkenz@xxxxxxxxxxxxxx>
  • To: thin@xxxxxxxxxxxxx
  • Date: Mon, 5 Aug 2002 17:08:02 -0400

Here ya go:
'the following is an example of how to modify terminal server settings
'feb 12, 2001 added SetTSConfigfAllowLogonTerminalServer (requested by Lance
Francis)
'thx to Jonathan Reininger for indepth testing

'contact bhay@xxxxxxxxxxxx for help, feedback, or donations
'script requires:
'   wts_admin.dll to be registered
'   terminal server 4 or windows 2000
'   wtsapi32.dll (included in the above os's)

dim obj
set obj=createobject("wts_admin.functions") 'accessible after registering
wts_admin.dll

dim retval 'integer
dim server,userid,homedir,homedrive,profilepath,homedirectory 'string
dim bLogin 'boolean

'following variables required for all functions utilized in this script
server="wopr" 'domain controller or terminal server (use terminal server if
server is standalone)
userid="test" 'userid to modify

' * * *          set user's profile path
profilepath="\\yourserver\someshare" 'new directory to change user's
homedirectory to.
'retval=obj.settsprofilepath(server,userid,profilepath)

' * * *          set user's home drive (requires home directory to be set
also)
homedrive="X" 'new driveto change user's homedrive to.
'retval=obj.settshomedrive(server,userid,homedrive)

' * * *          set user's home directory
homedirectory="\\myserv\myhome"
'retval=obj.SetTSHomeDirectory(server,userid,homedirectory)

' * * *          set whether user is allowed to login to terminal server
bLogin=False 'boolean value
retval=obj.SetTSConfigfAllowLogonTerminalServer(server,userid,bLogin)

'the following return value is the value returned from the api.  0=success
if retval=0 then
        wscript.echo "failure. return value: "&retval
else
        wscript.echo "success. return value: "&retval
end if

'notes:
'If the function succeeds, the return value is a nonzero value.
'If the function fails, the return value is zero. To get extended error
information, call GetLastError.
'GetLastError not implemented at this time.  in the future the return value
will be the GetLastError value
'to test the different functions above simply remark out those that are not
used and unremark
'  the function being tested


I can't remember where I got this from but there is also a dll in the file
that you can use.
See http://thethin.net/wts_admin.zip

Regards,
Jim Kenzig
http://thethin.net


-----Original Message-----
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx]On
Behalf Of Adam_Baum@xxxxxxxxxxxxx
Sent: Monday, August 05, 2002 4:46 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] VBscript for checking User Manager settings



Does anyone know how to read the TS Config portion of User Manager using
VBScript?  My semi-literate scripters can pretty much parse everything, but
the TS config.  They tell me they don't know the obejct info.  Since I am
not a VBer, I am not 100% sure of what they mean.

Any sample code would be much appreciated.

adam




===================================
This weeks Sponsor:
triCerat, Inc
ScrewDrivers fxp: Self Configuring Printer Driver with Bandwidth Control
Learn more at:
http://www.tricerat.com/?page=products&product=sdfxp

===================================
For Archives, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm



===================================
This weeks Sponsor:
triCerat, Inc
ScrewDrivers fxp: Self Configuring Printer Driver with Bandwidth Control
Learn more at:
http://www.tricerat.com/?page=products&product=sdfxp

===================================
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link.

http://thethin.net/citrixlist.cfm

Other related posts: