-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hello,
Great functions to simplify Graph API access.
Never the less it seems I have an issue using it to loop on all our AD (on prem) users and collecting their signin information.
After around one hour running I have error saying "message": "Access token has expired.",
He are the line of my code extracting the UserID from AD UPN and then requesting for beta signin informations
$URI = "https://graph.microsoft.com/v1.0/users/" + $User.UserPrincipalName + "?`$select=id
$ID = (Invoke-MSGraphQuery -URI $URI -token $token -tokenrefresh -credential $credential -tenantID $TenantId).id
$URI = "https://graph.microsoft.com/beta/users/" + $ID + "?`$select=userPrincipalName, signInActivity"
$SignInData = Invoke-MSGraphQuery -URI $URI -token $token -tokenrefresh -credential $credential -tenantID $TenantId | select -ExpandProperty Value
What I miss so that it doesn't refresh the token after one hour?
Thanks for help
Metadata
Metadata
Assignees
Labels
No labels