Share via


Revoke-SPOUserSession

Provides IT administrators the ability to invalidate a particular users' O365 sessions across all their devices.

Syntax

Default (Default)

Revoke-SPOUserSession
    [-User] <String>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

You must be a Global Administrator to run the cmdlet.

Requires a valid Connect-SPOService context to identify the tenant. For information about how to connect to the tenant, see Connect-SPOService.

When the cmdlet is run the following will occur:

User will be signed out of browser, desktop and mobile applications accessing Office 365 resources across all devices.

Will not be applicable for guest users.

Possible results for this cmdlet are:

Result Reason
Warning : We couldn't find the user@contoso.com. Check for typos and try again. Invalid input for -User parameter.
We successfully signed out <user> from all devices. Successful instantaneous revocation.
It can take up to an hour to sign out <user> from all devices. Successful non-instantaneous revocation.
Sorry, something went wrong and we couldn't sign out <user> from any device. The cmdlet did not successfully execute.
The cmdlet will be available in the future, but it isn't ready for use in your organization yet. The cmdlet has been disabled for the tenant.

Examples

EXAMPLE 1

Revoke-SPOUserSession -User user1@contoso.com

This example signs out user1 in the Contoso tenancy from all devices.

EXAMPLE 2

Revoke-SPOUserSession -User user1@contoso.com -Confirm:$false

This example signs out user1 in the Contoso tenancy from all devices without prompting for confirmation.

Parameters

-Confirm

Applicable: SharePoint Online

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-User

Applicable: SharePoint Online

Specifies a user name. For example, user1@contoso.com

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Applicable: SharePoint Online

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object