0
votes

I'm wanna query like the condition below.

"E5 Licensed Users with LastSignInDateTime Delayed by More than 30 Days"

The method I used for the query is as follows.

$skuID = Invoke-RestMethod -Uri 'https://graph.microsoft.com/beta/users?$filter=signInActivity/lastSignInDateTime le 2020-08-01T00:00:00Z and (assignedLicenses @{skuId} eq "c7df2760-2c81-4ef7-b578-5b5392b571df")' -Headers $Headers

but it doesn't work.

Invoke-RestMethod : { "error": { "code": "BadRequest", "message": "Invalid filter clause", "innerError": { "date": "2020-08-31T11:46:15", "request-id": "eeb58015-c6c2-437d-af1d-93227224133e" } } } 위치 줄:1 문자:10

  • $skuID = Invoke-RestMethod -Uri 'https://graph.microsoft.com/beta/use ...
  •      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Is there any way?

+And if you look up the user in API, only 100 people can be inquired. Is there a way to check all users?

this is Graph API's limit what I found.

https://docs.microsoft.com/en-us/graph/throttling#pattern

1
Please try this Graph api in graph explorer https://graph.microsoft.com/beta/users?$filter=signInActivity/lastSignInDateTime le 2020-08-01T00:00:00Z&assignedLicenses/any(x:x/skuId eq XXX7a907fd6c235)&$select=id,displayname and let us know if it helps.Sruthi J

1 Answers

-1
votes

Please try this Graph API in graph explorer

Get https://graph.microsoft.com/beta/users?$filter=signInActivity/lastSignInDateTime le 2020-08-01T00:00:00Z&assignedLicenses/any(x:x/skuId eq XXX7a907fd6c235)&$select=displayname

enter image description here