Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Terminal Server User count

Status
Not open for further replies.

sparkbyte

Technical User
Joined
Sep 20, 2002
Messages
879
Location
US
My management came to me and requested a way to monitor the user accounts across a 3 Terminal Server farm. The gotchya here is that the farm is shared for multiple client accounts and management only wants to monitor the usage of one of the clients on the farm.

So does anyone have some examples of how to get a list of user Logon ID's from a Terminal Server. These servers are all Win2k3 with SP1.

I from the listing of user ID's I can determin which client they belong to either from the ID itself or from their group memberships. The ID's are all prefixed with a client ID number. (381tsmith).

I am needing to put something together quickly! They want numbers they can initialy use for guestimates by this eve.

Thanks in advance !!!!!

Here is a little RegExp function that will 'peal' out the custID number.

Code:
WScript.Echo(RegExpTest("(([0-9]){3})","393jsmith"))
WScript.Quit

Function RegExpTest(patrn, strng)

   Dim regEx, Match, Matches   ' Create variable.

   Set regEx = New RegExp   ' Create a regular expression.

   regEx.Pattern = patrn   ' Set pattern.

   regEx.IgnoreCase = True   ' Set case insensitivity.

   regEx.Global = True   ' Set global applicability.

 Set Matches = regEx.Execute(strng)   ' Execute search.

   For Each Match in Matches   ' Iterate Matches collection.

'      RetStr = RetStr & "Match found at position "

'      RetStr = RetStr & Match.FirstIndex & vbcrlf & "Match Value is "

      RetStr = RetStr & Match.Value & vbcrlf

   Next

   RegExpTest = RetStr

End Function

or this

Code:
'Bind to the user object so that we can read it's values
Set UserObj = GetObject("WinNT://" & WSHNetwork.UserDomain & "/" & UserString)

	strUser = UserObj.Name 'store users full name 
	strBank = (Left(UserObj.Name,3)) ' Grab the first 3 characters of the username

Thanks again!!


Thanks

John Fuhrman
Titan Global Services
 
not sure whats built in to TS, actually not sure that i can be of any help at all,,,,not a bad feeling, means i can put my feet up, drink beer and eat pizza.

only stuff i have done for auditing TS was in a historic manor, all users ran a TS logonscript, which wrote to central audit share a text file for each user givin details of there current logon and then a history.txt file for each user (in a folder belonging to the username) the history.txt file logged which farm, what time, username etc. we then a little admin scirpt which ran off and recursed all the log folders and brought data together into a csv file

as i say perhaps TS has something built in
 
Nope. TS doesn't have anything like this. Pretty well blows.

What I was hoping for would be a WMI(or whatever) script that can determin who is logged onto a win2k3 server from that I should be able to peel out who is who. Since these are dedicated Terminal Servers all the users on them will be TS users.

Thanks!!


Thanks

John Fuhrman
Titan Global Services
 
i would go logonscript way, less intrusive, and might prove useful for other auditing information.

does LanMan or what it is called log open sessions, like the old server manager or whatever? this shoudl show sessions? might be in totally the wrong direction

Set FileService = GetObject("WinNT://computerdomain/computername/LanmanServer")
For Each aSession In FileService.Sessions
Wscript.Echo Session.Name & "=" & Session.User
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top