Abmeldung in Microsoft 365 Diensten forcieren

In manchen Fällen ist es erforderlichen einen Benutzeraccount schnell in allen Microsoft 365 Diensten abzumelden. Eine Anleitung wie es über das Admin Center und via PowerShell durchgeführt wird.

Accounts mit der Rolle Global Admin, User Admin, Helpdesk Admin, Authentication Admin und Privileged Authentication Admin können die Abmeldung forcieren. Beachte die Admin-Rollen für eine aktuelle Übersicht (suche nach invalidateAllRefreshTokens).


Im Microsoft 365 Admin Center

  • Öffne im Microsoft 365 Admin Center die Liste aller aktiven Acccounts.
  • Wähle den betroffenen Benutzeraccount aus.
  • Neben der Angabe wann das letzte Login stattgefunden hat gibt es die Option eine Abmeldung zu erzwingen. Ohne der passenden Admin-Rolle siehst du die Option nicht.
  • Damit widerruft das System innerhalb 15 Minuten die Anmeldetoken.

Via PowerShell

Mit PowerShell ist die erzwungene Abmeldung ebenso möglich.

PowerShell
# Initiate a log-off for user accounts and revoke the access token to Microsoft 365 services. 
# For my blog post at https://go.topedia.com/oStXV.

Connect-AzureAD
$ADUser = Get-AzureADUser -Filter "userPrincipalName eq '[UserPrincipalName]'"
Revoke-AzureADUserAllRefreshToken -ObjectId $ADUser.ObjectId

# Optional, to disable the account
Set-AzureADUser -ObjectID $ADUser.ObjectId -AccountEnabled $false

Im Azure Audit Log werden die forcierten Abmeldungen unter der Aktivität „Update StsRefreshTokenValidFrom Timestamp“ protokolliert.

Share this post:

About the Author

Tobias Asböck

Tobias Asböck

Tobias is a Senior System Engineer with more than 10 years of professional experience with Microsoft 365 products such as SharePoint Online, OneDrive for Business, Teams Collaboration, Entra ID, Information Protection, Universal Print, and Microsoft 365 Licensing. He also has 15+ years of experience planning, administering, and operating SharePoint Server environments. In his spare time, Tobias is busy with updates in the Microsoft 365 world or on the road with his road bike and other sports activities. If you have additional questions, please contact me via LinkedIn or support@topedia.com.

No comments yet