How to access Office365/Azure using powershell without an Azure subscription

Tom Vernier 0 Reputation points
2025-06-19T05:48:42.25+00:00

Hi,

We currently have office365 licenses and sometimes a new of ours gets a log in failure loop, eg. User sign-ins (non-interactive) Sign In error code : 50173.

The solution is to run "Revoke-AzureADUserAllRefreshToken -ObjectId xxxx-xxx-xxx-xx ", as listed here - https://learn.microsoft.com/en-us/answers/questions/1609934/user-sign-ins-(non-interactive)-sign-in-error-code, however due to not having an Azure license, im unable to connect to our instance to run the single cmd.

Has anyone run into this issue?
It doesnt seem that refreshing auth tokens from either

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kavya 495 Reputation points
    2025-07-30T05:58:01.8566667+00:00

    You don’t need an Azure subscription to revoke a user session. Also, note that the Azure AD PowerShell module is being deprecated. So it’s better to switch to Microsoft Graph PowerShell.

    1. Install and connect to Microsoft Graph PowerShell.
      https://m365scripts.com/microsoft365/connect-to-microsoft-graph-powershell/
    2. Then run the following cmdlet to revoke user sessions:
    Revoke-MgUserSignInSession -UserId <userid>
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.