Logging Windows 2003 Terminal Server Connections
(Page 1 of 4 )
There are any number of reasons why you might want to know how many users are currently connected to a database. If you're a system administrator, you would probably like to be able to run a script that gives you that number automatically. This article explains how to do just that.
Introduction
Quite a lot of businesses are moving their client base onto terminal servers. This gives obvious benefits to the business such as better disaster recovery, ease of support for helpdesk personnel and ease of upgrading.
While this brings benefits to the business, it can sometimes be quite hard to manage the environment.
There could be upwards of 20 servers to look after. You might need to know how they are performing under a certain user load, and make sure that the load is balanced correctly over all the available hardware.
This article explains a way you can run a process on the terminal servers that will log the current number of currently connected users into a database, using a VB script and a batch file.
Create the Database Table
For this article I am using a SQL2000 database, but you can use anything you can update via your VB script. You need to create a table as follows to hold the information:
Colum Name | Data Type | Length |
server_name | varchar | 50 |
current_count | decimal | 9 |
last_count_time | datetime | 8 |
active_status | decimal | 9 |
Now save the table as ts_status. Now we can create the batch file that will get the actual user information from the terminal server.
Next: Creating the Batch File and Why it’s Used >>
More BrainDump Articles
More By Luke Niland