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

Querying OData from PowerShell


Philippe DeLosSantos

Question

Hello all,

 

I've been playing with PowerShell to query Odata (first time I've ever done this) and have been successful with simple queries such as:
Invoke-RestMethod -UseDefaultCredentials -uri 'http://DDC.fqdn/Citrix/Monitor/OData/v3/Data/Sessions()?$top=10'

Invoke-RestMethod -UseDefaultCredentials -Uri 'http://DDC.fqdn/Citrix/Monitor/OData/v3/Data/Sessions()?$filter=LogOnDuration gt 60000'

 

But I've been struggling with more complicated queries such as getting all sessions during a particular timespan:

Invoke-RestMethod -UseDefaultCredentials -uri 'http://DDC.fqdn/Citrix/Monitor/OData/v3/Data/Sessions()?$filter = StartDate ge datetime'2019-06-16T04:15:00' and StartDate le datetime'2019-06-17T21:00:00''

 A positional parameter cannot be found that accepts argument '2019-06-16T04:15:00 and StartDate le datetime2019-06-17T21:00:00'

 

Any hints?

tyia 

Link to comment

1 answer 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...