Removing my code as part of the equation, I was able to reproduce this through the Microsoft Graph API Explorer.
First, I Do a GET https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses%2fany(d%3ad%2fskuid+eq+ --actualySKUIDHere--)
I get results back like
{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users", "@odata.nextLink": "https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses%2fany(d%3ad%2fskuid+eq+ --actualSKUIDHere-- )&$skiptoken=X%27 --actualtokenhere-- %27", "value": [ {
I copy paste the nextLink into the API Explorer
ie.
https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses%2fany(d%3ad%2fskuid+eq+ --actualSKUIDHere-- )&$skiptoken=X%27 --actualtokenhere-- %27
and it works with good results like above, but the next skipToken is shorter and copy & pasting it will result in the following
{ "error": { "code": "Directory_ExpiredPageToken", "message": "The specified page token value has expired and can no longer be included in your request.", "innerError": { "request-id": "4cce84ea-83c5-403a-98d2-5ad5c948fcdc", "date": "2020-02-03T21:04:43" } } }
I'm assuming this is a bug but wanted to post to see if anyone else has experienced this and has a resolution
https://graph.microsoft.com/v1.0/users?$top=999&$filter=assignedLicenses/any(x:x/skuId eq [skuID])
– Ryan