0
votes

I'm starting to migrate my PowerShell scripts to Microsoft Graph module.

I'm using this site to see the new cmdlets: https://docs.microsoft.com/en-us/powershell/microsoftgraph/azuread-msoline-cmdlet-map?view=graph-powershell-beta

I need to be able to do what I used to do in this part of the code:

Revoke-AzureADUserAllRefreshToken -ObjectId $O365User.ObjectId -ErrorAction Stop

So I have checked that I needed to use this cmdlet: https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.users.actions/invoke-mginvalidateuserrefreshtoken?view=graph-powershell-beta&preserve-view=true

The problem is that it doesn't exist on the module... I'm using the latest version: 1.9.6

1

1 Answers

0
votes

I am having the same issue. I found this as a workaround:

$requestUri = "/beta/users/" + $MgUser.Id + "/invalidateAllRefreshTokens"
$revoke = Invoke-GraphRequest -Method POST -Uri $requestUri

Ref: https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1092