Windows Vista Forums

Retrieve Number of remote Terminal Server users
  1. #1


    Ian_1 Guest

    Retrieve Number of remote Terminal Server users

    Looking for something at will just output "There are 32 users on Server1". If
    it was possbile to GET from a test file with server names so it would just
    read:
    There are 35 users on Server1
    There are 15 users on Server2
    There are 32 users on Server3
    There are 45 users on Server4
    There are 31 users on Server5

    That would be awesome. Thanks in advance-




      My System SpecsSystem Spec

  2. #2


    Brandon [MVP] Guest

    Re: Retrieve Number of remote Terminal Server users

    You can use Win32_PerfFormattedData_TermService_TerminalServices for This

    Get-WMIObject Win32_PerfFormattedData_TermService_TerminalServices

    It has these useful properties
    ActiveSessions : 1
    InactiveSessions : 1
    TotalSessions : 2

    Here is an Example Script

    foreach($server in (Get-Content $file))
    {
    $count = (Get-WMIObject
    Win32_PerfFormattedData_TermService_TerminalServices).TotalSessions
    "There are {0} users on {1}" -f $count,$Server
    }

    "Ian_1" <fakeaddy@xxxxxx> wrote in message
    news:0031F476-6BE1-4462-A090-8E212B3BC5F1@xxxxxx

    > Looking for something at will just output "There are 32 users on Server1".
    > If
    > it was possbile to GET from a test file with server names so it would just
    > read:
    > There are 35 users on Server1
    > There are 15 users on Server2
    > There are 32 users on Server3
    > There are 45 users on Server4
    > There are 31 users on Server5
    >
    > That would be awesome. Thanks in advance-
    >

      My System SpecsSystem Spec

Retrieve Number of remote Terminal Server users problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
SBS 2008 remote admin and terminal server PaulB SBS Server 4 17 Jan 2010
Users cannot change password in win2k8 terminal server gjl_support Server General 0 22 Dec 2009
How can I check status of Terminal Services connections on remote server? Kevin Buchan PowerShell 1 07 Jan 2009
remote desktop connection to my terminal server Kees Brussen Vista General 1 20 Feb 2008
Remote Desktop Probem - Vista to Terminal Server 2003 Nav User Vista General 0 09 Jun 2007