• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1127
  • Last Modified:

Get the list of all the machines and no of client can loggin through Mstsc

Hi,

Is there a way to retrieve how many users can loggin to the machines in the file.How many can loggin with or without terminal services installed.

Regards
Sharath
0
bsharath
Asked:
bsharath
  • 31
  • 25
  • 9
  • +1
1 Solution
 
Alan Huseyin KayahanCommented:
      Hi Sharath
            As I know, you have a domain and for a domain, this question is wrong. Because any Remote Desktop Users group member can login to any computer via RDP that Remote Desktop is enabled. Would you please explain your question?

Regards
0
 
bsharathAuthor Commented:
You are correct MrHusy,

What i wanted is.There are machines with and without Terminal services enabled.If the win 2003 is without terminal service enabled then only 2 connections are allowed and if TS is enabled then it depends on how many connections we have set.This is what i wanted to know.How many TS sessions can be connected in each machine.What has the user defined.With some code which can fetch this info for 1 or all machines.Remotely.
0
 
Farhan KaziSystems EngineerCommented:
:: ===============
:: READ THIS FIRST
:: ===============
:: * This script require "Computers.txt" file on C: drive root from where it will read computer names.
:: * Successful run will generate "TSConReport.txt" on C: drive root.
:: * Copy and paste following script in notepad and save it with any name having .cmd extension.
:: *** SCRIPT START ***

@Echo Off
SetLocal EnableDelayedExpansion

IF EXIST C:\TSConReport.txt DEL /F /Q C:\TSConReport.txt
IF NOT EXIST C:\Computers.txt Goto ShowErr
FOR %%R IN (C:\Computers.txt) Do IF %%~zR EQU 0 Goto ShowErr

FOR /F "delims=#" %%c IN (C:\Computers.txt) Do (
      Echo Processing: %%c
      Ping -n 1 -w 1000 %%c|Find /I "TTL" >nul
      IF NOT ErrorLevel 1 Call :GetMaxCon %%c
)
Goto :EndScript

:GetMaxCon
SET TSS=WMIC /Node:%1 RDNIC GET MaximumConnections
FOR /F "Skip=1 Tokens=1 delims= " %%m IN ('!TSS!') Do (
    IF %%m GEQ 0  (Echo Maximum connections on '%%c' = %%m>>C:\TSConReport.txt)
    IF %%m EQU -1 (Echo Maximum connections on '%%c' = Unlimited>>C:\TSConReport.txt)
)

Goto EndScript
:ShowErr
Echo "C:\Computers.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: Batch Script End
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
bsharathAuthor Commented:
I get this

Processing: indiasophos
Processing: dev-chen-mrd100
Invalid Global Switch.
Processing: dev-chen-nas01
Invalid Global Switch.
Processing: dev-chen-pc2000
Invalid Global Switch.
Processing: dev-chen-pc2001
Processing: dev-chen-pc2002
Invalid Global Switch.
Processing: dev-chen-pc2003
Invalid Global Switch.
0
 
Farhan KaziSystems EngineerCommented:
Apply following commands and post results:

Click Start -> Run -> Cmd.exe
WMIC /Node:dev-chen-mrd100 RDNIC GET MaximumConnections
WMIC /Node:dev-chen-pc2002 RDNIC GET MaximumConnections
WMIC RDNIC GET MaximumConnections
0
 
bsharathAuthor Commented:
C:\>WMIC /Node:dev-chen-mrd100 RDNIC GET MaximumConnections
Invalid Global Switch.
C:\>WMIC /Node:dev-chen-pc2002 RDNIC GET MaximumConnections
Invalid Global Switch.
C:\>WMIC RDNIC GET MaximumConnections
MaximumConnections
-1
0
 
Farhan KaziSystems EngineerCommented:
What about following?

WMIC /Node:"dev-chen-mrd100" RDNIC GET MaximumConnections
WMIC /Node:"dev-chen-pc2002" RDNIC GET MaximumConnections
0
 
bsharathAuthor Commented:
C:\>WMIC /Node:"dev-chen-mrd100" RDNIC GET MaximumConnections
MaximumConnections
-1

C:\>WMIC /Node:"dev-chen-pc2002" RDNIC GET MaximumConnections
MaximumConnections
1
-1
0
 
Farhan KaziSystems EngineerCommented:
Check this:

:: ===============
:: READ THIS FIRST
:: ===============
:: * This script require "Computers.txt" file on C: drive root from where it will read computer names.
:: * Successful run will generate "TSConReport.txt" on C: drive root.
:: * Copy and paste following script in notepad and save it with any name having .cmd extension.
:: *** SCRIPT START ***

@Echo Off
SetLocal EnableDelayedExpansion

IF EXIST C:\TSConReport.txt DEL /F /Q C:\TSConReport.txt
IF NOT EXIST C:\Computers.txt Goto ShowErr
FOR %%R IN (C:\Computers.txt) Do IF %%~zR EQU 0 Goto ShowErr

FOR /F "delims=#" %%c IN (C:\Computers.txt) Do (
      Echo Processing: %%c
      Ping -n 1 -w 1000 %%c|Find /I "TTL" >nul
      IF NOT ErrorLevel 1 Call :GetMaxCon %%c
)
Goto :EndScript

:GetMaxCon
SET TSS=WMIC /Node:"%1" RDNIC GET MaximumConnections
FOR /F "Skip=1 Tokens=1 delims= " %%m IN ('!TSS!') Do (
    IF %%m GEQ 0  (Echo Maximum connections on '%%c' = %%m>>C:\TSConReport.txt)
    IF %%m EQU -1 (Echo Maximum connections on '%%c' = Unlimited>>C:\TSConReport.txt)
)

Goto EndScript
:ShowErr
Echo "C:\Computers.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: Batch Script End
0
 
bsharathAuthor Commented:
I get this in the file
Maximum connections on 'dev-chen-mrd100' = Unlimited
Maximum connections on 'dev-chen-pc1014' = 1
Maximum connections on 'dev-chen-pc1014' = Unlimited


I get this when i run the script.


C:\>"RDP connections allowed.bat"
Processing: dev-chen-mrd100
Processing: dev-chen-pc1014

No what happens is why is it showing 2 entries for dev-chen-pc014 and in dev-chen-mrd100 i have only 2 connections enabled but the output shows as unlimited.
0
 
Farhan KaziSystems EngineerCommented:
How many Network interface cards are installed in "dev-chen-pc1014" machine?
Recheck TS configuration on "dev-chen-mrd100" machine.

0
 
bsharathAuthor Commented:
In TS in Mrd100 in network adapter > Maximum connections is 2
Dev-chen-pc1014 there are 1 network card
0
 
Farhan KaziSystems EngineerCommented:
Try changing Maximum Connections on "dev-chen-pc1014" to 1 and then run script and check changes are reflected or not.

Apply following commands and post results.
Click Start -> Run -> Cmd.exe
WMIC /Node:"dev-chen-mrd100" RDNIC GET
WMIC /Node:"Dev-chen-pc1014" RDNIC GET
0
 
bsharathAuthor Commented:
C:\>WMIC /Node:"dev-chen-mrd100" RDNIC GET
Caption  Description  MaximumConnections  NetworkAdapterID
  NetworkAdapterName                                  SettingID  TerminalName
                      -1                  {00000000-0000-0000-0000-000000000000}
  All network adapters configured with this protocol             RDP-Tcp


C:\>WMIC /Node:"Dev-chen-pc1014" RDNIC GET
Caption  Description  MaximumConnections  NetworkAdapterID
  NetworkAdapterName                                  SettingID  TerminalName
                      -1                  {00000000-0000-0000-0000-000000000000}
  All network adapters configured with this protocol             RDP-Tcp
0
 
bsharathAuthor Commented:
Any help...
0
 
Farhan KaziSystems EngineerCommented:
Try changing 'Maximum Connections' value on few PC's and then run above script and check changes are reflected or not.

0
 
bsharathAuthor Commented:
farhankazi
I tried changing for some it is working fine for others even though Terminal is not installed in these machines it is showing "Unlimited"
If terminal is not installed it should show only 2 correct?
If i am running on a Xp machine it should show only 1 correct?
0
 
Farhan KaziSystems EngineerCommented:
Correct, I'll modify this and post it here in few hours.
0
 
bsharathAuthor Commented:
Thanks...
0
 
bsharathAuthor Commented:
Farhankazi
can you please see this solution.If this may help you in scripting one for this Q.
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Q_22722261.html
0
 
zoofanCommented:
Changing my RDP MAX connections from 1 to 2 and back yielded this for a result
From ONE
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\Rdp-Tcp\MaxInstanceCount

   Old value: DWORD: 1 (0x1)
   New value: DWORD: 2 (0x2)

Too TWO
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\Rdp-Tcp\MaxInstanceCount

   Old value: DWORD: 1 (0x1)
   New value: DWORD: 2 (0x2)


So rsharath
open regedit and goto the the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\

and tell me if there is one entry for each of your connections with a setting of MaxInstanceCount .  If so I can enumerate all the sub keys below \WinStations and then add up the maxes for each, subract that from the Total active in our last script and give you all of it I think.

zf
0
 
zoofanCommented:
It would also help if you went into terminal services managment and changed one of those max vaules in the window then rechecked the setting the registry to make sure they all match on your end as well.

zf
0
 
bsharathAuthor Commented:

In this path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\
I only have

Default
ConsoleSecurity
DefaultSecurity
0
 
zoofanCommented:
Was afraid it wouldnt be that easy.......

Sadly I have no TS license to test and find it with.

Try reopening regedit and select mycomputer at the top.  Do a search for "The Exact Name" the name of one of your connections listed in the TS manager(the test listed as "Connection".  Shot in the dark.

zf
0
 
zoofanCommented:
Might also try doing a search for "MaxInstanceCount"

and see if any of the returns are within a key named for one of your connections.

zf
0
 
bsharathAuthor Commented:
In this path i found MaxInstanceCount

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-tcp

value data
ffffffff
0
 
zoofanCommented:
Ok that is where farhankazi's option is returning Unlimited as FFFFFFFF = -1

Do you connections with a max count set? I assume you do.  And this was the only place "MaxInstanceCount" showed.  any result from the search for connection name?

zf
0
 
bsharathAuthor Commented:
connection name you mean machine name of?
0
 
zoofanCommented:
In your terminal Services Manager MMC you should have a list of "Connections" on the TS that name.

Exmaple on my server I have "RDP-Tcp" listed under connections.

zf
0
 
zoofanCommented:
Work in an hour will pick this up again tonight.  Would like to hear farhankazi thoughts as well, as he has contributed great effort here already.  His option may work but I think he'll need to enum all the net interfaces.

zf
0
 
bsharathAuthor Commented:
Even i have the same RDP-Tcp and console (Sharath)
0
 
zoofanCommented:
Bsharath, you have a  running TS server with a valid license installed and the only listing for connections is "RDP-Tcp"?

If so and you set the value of MaxInstances for that connection to the number of licensed connections you have. That should be it.  Im guessing that you can set this to what ever you want but after 120 days the license die's unless it was issued buy an actived license server.  Not really sure.  Still reading.........

Enumerating all the MaxInstance values stored for each connection under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\

seems the only way I can figure to get to get total licenses at the moment.


zf
0
 
zoofanCommented:
Yup I think it is so.

try this one.

'==start copy==
'get allowed number of connections
strComputer = InputBox("Please enter the TS server name","Query server for allowed connections")
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_TSNetworkAdapterSetting")

For Each objItem in colItems
    WScript.Echo objItem.MaximumConnections
Next
'==end copy==

zf
0
 
bsharathAuthor Commented:
I get -1 as the results fr this script
0
 
zoofanCommented:
If you login to that server and run terminal services configuration and right click on your connection to view its properties i bet its max connections is set to unlimited.

zf
0
 
bsharathAuthor Commented:
Yes you are correct it is unlimited
0
 
zoofanCommented:
Unlimited is set as FFFFFFFF which is acutally -1

zf
0
 
zoofanCommented:
Do you have any TS servers that have maxconnections set at a value and not at unlimited? If so test them.

zf
0
 
bsharathAuthor Commented:
This is the only server i have.
0
 
zoofanCommented:
Change its setting from unllimited to 500 rerun the script.  It will return 500.  Thats the only server limit on connections that I belive your going to be able to read.


zf
0
 
bsharathAuthor Commented:
I just search and i have another lic server
0
 
zoofanCommented:
There is no way to get Licesed limits that Im aware of as the license server will issue temporary licenses that expire after 120 days.  Your only known controlable limit is that max connections setting.

zf
0
 
bsharathAuthor Commented:
And ever in that server is unlimited.
0
 
zoofanCommented:
Well they will return unlimited if that is what you set them to!!!!  

Go into Termianl Services Configuration on one of those servers, right click your connection "RDP-Tcp" and select the "Network Adapter" tab,  Select "Maximum COnnections" and enter a value.





zf
0
 
bsharathAuthor Commented:
Done.On one server i have changed the connections to 20.
0
 
zoofanCommented:
And the script resopnded with shallwe say 20 when queried to that server?

zf
0
 
zoofanCommented:
Here is the complete and updated script with the previous script adding in the MaxConnections.

'===Start copy: getsessions.vbs===
' ---------------------------------------------------------------'
' getsessions.vbs
' 'Sample VBScript to query remote computers
' 'and return terminal service's sessions.
' ''Author Riley C. aka ZooFan
' '''Version 3.8 - July 2007
' ''''www.experts-exchange.com question ID: 22722261
' ---------------------------------------------------------------'
'
Option Explicit
'Declare variables
Const ForReading = 1, ForWriting = 2, ForAppending = 3 'FileObject Access Type
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 'FileObject Format Type
Dim objWbemLocator'Object for WScript used in (Function getsessions) to connect to remote pc
Dim objFso 'Object for WScript used to access our file system
Dim objWshShell'Object for WScript used in (Function IsDomainAdmin) to get logon server name
Dim objNetwork 'Object for WScript used in (Function IsDomainAdmin) to retreive list of groups and members
Dim objOutputFile 'Object for WScript used for our results
Dim objPCnames 'Object for WScript used to open the pc list file
Dim objReadFile 'Object for WScript used to read the pc list file
Dim strPCFile 'Store path and name of file used for pc list
Dim strUsername 'Store username
Dim strPassword 'Store Password
Dim strCurPath 'Store our current path
Dim strResultsFile 'Our results file
Dim intLneCount 'Our loop counter for each line of pc list
Dim dte 'Used to store date so we can format it to valid file name charset
Dim tme 'Used to store time so we can format it to valid file name charset
Dim intPCLoop ' Used for pc array name loop counter
Dim strReturn 'The return string from function getsessions
Dim arrValSplit 'The array for results returned from function getsessions
Dim strMaxCons 'Split max connection settings
'---Setup required objects
      Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
      Set objFso = CreateObject("Scripting.FileSystemObject")
      Set objWshShell = WScript.CreateObject("WScript.Shell")
      Set objNetwork = CreateObject("WScript.Network")
      strCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
'---Get file with computer list      
      strPCFile = InputBox("Please enter the full path and file" & VbCrLf & "name of the file with the computer names.","Get live sessions from remote computers.")
            'Test to make sure file exists if not exit script
            If Not objFso.FileExists(strPCFile) Then
                  MsgBox "You must enter a valid full path and file name!",vbOKOnly,"Get live sessions from remote computers."
                WScript.Quit(0)
            Elseif strPCFile = "" Then
                  MsgBox "You must enter a filename!",vbOKOnly,"Get live sessions from remote computers."
                WScript.Quit(0)               
            Else 'File exists continue
                                    'Create New text file for outputting our results
                                    dte = Replace(FormatDateTime(date(),vbshortdate),"/","-")
                                    tme = Replace(Replace(FormatDateTime(now(),vbLongtime),":","-")," ","")
                                          strResultsFile = strCurPath & "\" & tme & "_" & dte & ".txt"
                                                If objFSO.FileExists(strResultsFile) Then
                                                      ObjFSO.deleteFile(strResultsFile)
                                                Else
                                                      Set objOutputFile = objFso.CreateTextFile(strResultsFile)
                                                      objOutputFile.Close      
                                                End If
'-----------Get user account
                  strUsername = objNetwork.userName
                        'If current logged on user is not a memeber of administrators get a username
                        If IsDomainAdmin(strUsername) = True Then
'-----------------------Loop through file list
                                    strUsername = "current"
                                    strPassword = "current"
                                    Call runquery
                                    WScript.Quit(0)
                        Else
                              strUsername = InputBox("Please enter a username with adminsitrative access.","Get live sessions from remote computers.")
                                    If strUsername = "" Then
                                          MsgBox "You must enter a username!",vbOKOnly,"Get live sessions from remote computers."
                                    Else
                                          'If username entered is a member of adminsitrators get the password
                                          If IsDomainAdmin(strUsername) = True Then
                                                strPassword = InputBox("Please enter the password for that user account.","Get live sessions from remote computers.")
                                                      If strPassword = "" Then
                                                            MsgBox "You must enter a password!",vbOKOnly,"Get live sessions from remote computers."
                                                            WScript.Quit(0)
                                                      End If
                                          Else
                                                'User entered is not a member of adminsitrators group exit script
                                                MsgBox "That user account does not have adminsitrative rights!",vbOKOnly,"Get live sessions from remote computers."
                                                WScript.Quit(0)
                                          End If
                                    End If
                              Call runquery                        
                        End If      
            End If
      WScript.Quit(0)
'Function to return number of sessions of passed computer name      
Function getsessions(strComputer)
Dim strSessions 'Store total sessions
Dim strActive 'Store active sessions
Dim strInActive      'Store inactive sessions
Dim wbemServices
Dim Testme
Dim iErr
Dim colItems
Dim objItem
Dim GetMaxConnections
On Error Resume Next
      Set Testme = GetObject("winmgmts:\\" & strComputer,"Root\CIMV2")
      iErr = Hex(Err.Number)
            Select Case Ucase(iErr)
                Case 0
                        If strUsername = "current" And strPassword = "current" Then
                              Set wbemServices = objWbemLocator.ConnectServer(strComputer,"Root\CIMV2")
                        Else
                              Set wbemServices = objWbemLocator.ConnectServer(strComputer,"Root\CIMV2",strUsername,strPassword)
                        End If
                        Set colItems = wbemServices.ExecQuery("Select * from Win32_PerfFormattedData_TermService_TerminalServices",,48)
                              For Each objItem in colItems
                                       strSessions = " Total Sessions : " &  objItem.TotalSessions
                                       strActive = " Active Sessions : " & objItem.ActiveSessions
                                       strInActive = " Idle Sessions : " & objItem.InactiveSessions
                              Next
                              If strSessions = "" Or strActive = "" Or strInActive = "" Then
                              getsessions = "Error"
                              Else
                              GetMaxConnections = 0
                              Set colItems = wbemServices.ExecQuery ("Select * from Win32_TSNetworkAdapterSetting")
                              For Each objItem in colItems
                                  GetMaxConnections = GetMaxConnections + objItem.MaximumConnections
                              Next
                              getsessions = strSessions & "," & strActive & "," & strInActive & "," & GetMaxConnections
                              End If
            Case Else
                        getsessions = "Error"
            End Select
End Function
'Function to test passed user account for Administrator group membership.
Function IsDomainAdmin(strUser)
Dim strDomainDC
Dim objGroup
Dim objMember
strDomainDC = objWshShell.ExpandEnvironmentStrings("%LOGONSERVER%")
strDomainDC = Mid(strDomainDC,3,(len(strDomainDC)-2))
Set objGroup = GetObject("WinNT://" & strDomainDC & "/Administrators" & ",group")
For Each objMember In objGroup.Members
  if lcase(objMember.Name) = lcase(strUser) Then
        IsDomainAdmin = True
  end If
Next
End Function
Sub runquery
                                    'Read the list of computers into arrPCnames
                                    Set objPCnames = objFso.GetFile(strPCFile)
                                    Set objReadFile = objPCnames.OpenAsTextStream(ForReading, TristateUseDefault)
                                          Do Until objReadFile.AtEndOfStream
                                                ReDim Preserve arrPCnames(intLneCount)
                                                arrPCnames(intLneCount) = objReadFile.ReadLine
                                                intLneCount = intLneCount + 1
                                          Loop
                                    objReadFile.Close
                                    'Run a query on each pc in the list and output the reults to our file
                                          Set objOutputFile = objFso.OpenTextFile(strResultsFile,ForWriting,TristateUseDefault)
                                                For intPCLoop = LBound(arrPCnames) To UBound(arrPCnames)
                                                      strReturn = getsessions(arrPCnames(intPCLoop))
                                                            If strReturn = "Error" Then
                                                                   objOutputFile.WriteLine("Error connecting to: " & arrPCnames(intPCLoop))
                                                             Else
                                                                  arrValsplit = split(getsessions(arrPCnames(intPCLoop)),",")
                                                                  objOutputFile.WriteLine("Machine name : " & arrPCnames(intPCLoop) & arrValSplit(1) & arrValSplit(2) & arrValSplit(0) & " Max Connections: "& arrValSplit(3) & vbcrlf)
                                                             End If
                                                Next
                                           objOutputFile.Close      
                                    MsgBox "File has been processed, and results saved in " & strResultsFile ,vbOKOnly,"Get live sessions from remote computers."
End sub                        
'===End copy: getsessions.vbs===



zf
0
 
bsharathAuthor Commented:
Now i get this error.

---------------------------
Windows Script Host
---------------------------
Script:      C:\Ts session.vbs
Line:      4
Char:      1
Error:      0x80041021
Code:      80041021
Source:       (null)

---------------------------
OK  
---------------------------
0
 
bsharathAuthor Commented:
I get this.
Machine name : In-lic-srv01 Active Sessions : 2 Idle Sessions : 0 Total Sessions : 2 Max Connections: 20
1 session is the console and another i have connected through Mstsc.
0
 
zoofanCommented:
Check your copy and paste on the error. Line 4 is a comment

and that is the response you should be getting.

script works correctly....


zf
0
 
bsharathAuthor Commented:
Sorry that was my mistake.
Script is perfect.
Cant we find which is the remote session and which is the console.
0
 
bsharathAuthor Commented:
What happend when it runs on a xp machine.
what happend when it runs on a win 2003 machine
what happens when it runs on a win 2003 terminal service enable inb 120 days trial
0
 
zoofanCommented:
I could be wrong but as users can access terminal services in both as a RD and in a console, Im thinking that they both come of the licenses therefore its going to track them as a combined sessions count.


zf
0
 
zoofanCommented:
If you view the sessions in Terminal Service Manager, youll note that RD and console's are both listed and counted into the total sessions.

zf
0
 
zoofanCommented:
I created the script on a 03 server in 120 trial mode so that one works.  Your running in 03 non trial mode that one works, DOnt have an xp terminal servers box running to test it.

zf
0
 
bsharathAuthor Commented:
I get this for a machine win 2003 which is not installed with TS
Machine name : dev-chen-mrd100 Active Sessions : 1 Idle Sessions : 1 Total Sessions : 2 Max Connections: -1
0
 
zoofanCommented:
As the Terminal Services Server that you download and install in XP is the same service as it is installed in 03 server I'd imagine it will run fine.  but is a best guess still.

zf
0
 
zoofanCommented:
All 03 servers by default allow 2 Administrative RDP connections.  Without terminal services installed.
To my recollection.


zf
0
 
bsharathAuthor Commented:
Ok thanks a lot.Just posting a related question.Which if possible can you or farhankazi help me.

1. Find the OS type
2. Find which is a RDP and which is console
3. Find the time the machine is connected and idle.
4. Find the names of the users connected
5. If it is a licenced TS machine find from which server is it taking the licence.
6. Find if it is a trial TS installation.
Here is the Q path
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Q_22731874.html
THX
Sharath
0
 
zoofanCommented:
Hope the script does what you need it too, glad I could help.

cheers
zf
0
 
zoofanCommented:
Just my vote, If that script does what you need and you do accept it I reccomend a split with farhankazi as it was his "Maximum Connections" code  that got there.

zf
0
 
bsharathAuthor Commented:
Ok i never knew that.
Farhankazi your comments please.
0
 
Farhan KaziSystems EngineerCommented:
If zoofan's script works as per your requirement then credit goes to him.
0
 
bsharathAuthor Commented:
Cool Farhankazi.
0
 
bsharathAuthor Commented:
0
 
bsharathAuthor Commented:
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 31
  • 25
  • 9
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now