Jump to content
Welcome to our new Citrix community!
  • 0

Retrieve the number of concurrent sessions for the month using PowerShell


gcavall872

Question

Hello, I'm new to Citrix, and I need to schedule a monthly report using PowerShell, where I can read the number of users that connected to all Delivery Groups over a month. If that is not possible, I would need to automate what is already available through the console, which is: the "number of concurrent sessions" over the whole month. Then I will work out the resulting file to eliminate the duplicated usernames.

I went through https://developer.cloud.com/citrix-cloud/citrix-cloud-api-overview/docs/citrix-cloud-api-walkthrough#authenticate-to-citrix-cloud and I could successfully setup the access. Is there anybody who knows how to retrieve that value using PowerShell? Which cmdLets. 
I've installed the Citrix PowerShell SDK on our PowerShell server, and possibly I'd like to run the script from here, rather than on any other Citrix Server. We have a hybrid setup (cloud/on-prem)

Link to comment

2 answers to this question

Recommended Posts

  • 0

The SDK does not contain the Set-XDCredentials, so I had to logon onto a Citrix Connector (where the cmdLet is present) to run the following code:

 

and run the code:

 

Get-BrokerConnectionLog -Filter {BrokeringTime -gt $startofmonth} -MaxRecordCount 9999999

 

where start of the month is 1st september, but it only returns sessions from past 3 days. While if I do it from the console I get the full list of sessions. Any hint on where to run the code and if that cmdlet is the right one?

 

Link to comment
  • 0

For fetching no.of users connected, please use monitor odata endpoint http://{ApiGatewayEndpoint}/Sessions by passing valid arguments. Please refer docs https://developer-docs.citrix.com/en-us/monitor-service-odata-api/current-release/api-reference/monitor-model#monitormodelsession. For OData usage, please refer https://developer-docs.citrix.com/en-us/citrix-cloud/accessing-monitor-service-data-citrix-cloud-external

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...