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.
or this
Thanks again!!
Thanks
John Fuhrman
Titan Global Services
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