I am trying to retrieve all of the access requests that were submitted between a given date range. To do this, I am using the Get-V2025AccessRequestStatus cmdlet from the Powershell SDK. According to the API documentation, I should be able to filter the results by date. I have tried various date formats besides the ISO-8601 format, and I either get an error or zero results. Can someone guide me on the proper use of dates in my filter expression?
These are the values that I think are the most correct, but do not work:
$ISO8601 = "yyyy-MM-ddTHH:mm:ssZ"
# Does not work
$filter = "created ge ""$($startDate.ToString($ISO8601))"" and created le ""$($endDate.ToString($ISO8601))"""
Write-Host $filter
$accessRequests = Get-V2025AccessRequestStatus -Filters $filter -Sorters "created"
If I turn on debugging and verbose, this is the output:
DEBUG: Calling method: Get-V2025AccessRequestStatus
DEBUG: Parameter Value
DEBUG: --------- -----
DEBUG: Filters created ge "2025-08-01T00:00:00Z" and created le "2025-08-30T23:59:59Z"
DEBUG: Sorters created
DEBUG: Calling method: Invoke-V2025ApiClient
DEBUG: Parameter Value
DEBUG: --------- -----
DEBUG: Method GET
DEBUG: Uri /access-request-status
DEBUG: Accepts application/json
DEBUG: ContentTypes
DEBUG: Body
DEBUG: HeaderParameters {}
DEBUG: QueryParameters {[sorters, created], [filters, created ge "2025-08-01T00:00:00Z" and created le "2025-08-30T23:59:59Z"]}
DEBUG: FormParameters {}
DEBUG: CookieParameters {}
DEBUG: ReturnType RequestedItemStatus[]
DEBUG: IsBodyNullable False
DEBUG: Calling Endpoint: https://sci.api.identitynow.com/v2025/access-request-status
VERBOSE: Request Headers:
Name Value
---- -----
User-Agent OpenAPI-Generator/1.6.1/ps
Accept application/json
Authorization Bearer <redacted>
X-SailPoint-SDK Powershell-1.6.1
VERBOSE: Request Body:
VERBOSE: Requested HTTP/1.1 GET with 0-byte payload
VERBOSE: Received HTTP/1.1 2-byte response of content type application/json