David Griffiths Posted June 26, 2013 Share Posted June 26, 2013 How do I count the number of users curently on the citrix farm. As some users may be using more than one application. I need to group these users so i can see many many users are logged in at a point in time Link to comment
0 Jeffrey Combs Posted June 26, 2013 Share Posted June 26, 2013 I think you can get a list this way: Add-PSSnapin Citrix.* Get-XASession | Select-Object AccountName -Unique Link to comment
0 David Griffiths Posted June 26, 2013 Author Share Posted June 26, 2013 Thanks this what I need. Do you know how to add a count to the end of the script? Then export to database? Link to comment
0 Jeffrey Combs Posted June 26, 2013 Share Posted June 26, 2013 You can do it a couple ways to get the count. Here's one $users = Get-XASession | Select-Object AccountName -Unique | measure $users.count I won't cover details on exporting to a database. Jeff Link to comment
0 Benjamin Brockmann Posted June 26, 2013 Share Posted June 26, 2013 This will get it into a CSV file. I haven't worked with SQL in PowerShell, but Invoke-Sqlcmd is probably a good place to start. $users | export-csv -path "users.csv" .\users.csv Link to comment
0 David Griffiths Posted June 27, 2013 Author Share Posted June 27, 2013 sorry I am a newbie at Powershell. Tried script but got this error PS C:\Users\adm_griffith> $users = Get-XASession | Select-Object AccountName -Unique | measure $users.count Measure-Object : Property "104" cannot be found in any object(s) input. At line:1 char:69 + $users = Get-XASession | Select-Object AccountName -Unique | measure <<<< $users.count + CategoryInfo : InvalidArgument: (:) [Measure-Object], PSArgumentException + FullyQualifiedErrorId : GenericMeasurePropertyNotFound,Microsoft.PowerShell.Commands.MeasureObjectCommand Link to comment
0 Benjamin Brockmann Posted June 27, 2013 Share Posted June 27, 2013 The line ends after 'measure'. The '$users.count' should be on its own line. Link to comment
0 David Griffiths Posted June 27, 2013 Author Share Posted June 27, 2013 Thanks that worked fine. Would you know why when I output the result to csv it shows #TYPE System.Int32 $count = $users.count $users.count | export-csv -path c:\\Algeco\users.csv All i need is the number Thanks Link to comment
0 Benjamin Brockmann Posted June 27, 2013 Share Posted June 27, 2013 Doing a $users.count | export...+ will only export the count of the users to a csv - so you'll have a csv with one item in it. Doing +$users | export... will export the entire list of users. Link to comment
0 David Griffiths Posted July 3, 2013 Author Share Posted July 3, 2013 The ouput is fine I only need the count of users. Could you point me in the right direction for outputing the result to a sql table instead of a csv file. I have created a database called Citrixcount with a table called count. Afterward I can create a webpage to show the number of users accessing the citrix farm on a daily basis Thanks Link to comment
0 Srikant Patil Posted August 21, 2019 Share Posted August 21, 2019 Hi I am a newbie here, I want to monitor user counts on server farm because of lots of user connection we are facing slowness. Please can you please tell me where i need to run these command? Where can i run these commands? On sharepoint . I am trying to run these commands on my local windows server but getting below errors, S C:\Windows\system32> Add-PSSnapin Citrix.* Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 1. At line:1 char:1 + Add-PSSnapin Citrix.* + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (Citrix.*:String) [Add-PSSnapin], PSArgumentException + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand PS C:\Windows\system32> Get-XASession | Select-Object AccountName -Unique Get-XASession : The term 'Get-XASession' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Get-XASession | Select-Object AccountName -Unique + ~~~~~~~~~~~~~ Link to comment
Question
David Griffiths
How do I count the number of users curently on the citrix farm.
As some users may be using more than one application.
I need to group these users so i can see many many users are logged in at a point in time
Link to comment
10 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now