Table of Contents

Remove-PnPUser

SYNOPSIS

Removes a specific user from the site collection User Information List

SYNTAX

Remove-PnPUser [-Identity] <UserPipeBind> [-Force]  
 [-Connection <PnPConnection>] 

DESCRIPTION

This command will allow the removal of a specific user from the User Information List

EXAMPLES

EXAMPLE 1

Remove-PnPUser -Identity 23

Remove the user with Id 23 from the User Information List of the current site collection

EXAMPLE 2

Remove-PnPUser -Identity i:0#.f|membership|user@tenant.onmicrosoft.com

Remove the user with LoginName i:0#.f|membership|user@tenant.onmicrosoft.com from the User Information List of the current site collection

EXAMPLE 3

Get-PnPUser | ? Email -eq "user@tenant.onmicrosoft.com" | Remove-PnPUser

Remove the user with e-mail address user@tenant.onmicrosoft.com from the User Information List of the current site collection

EXAMPLE 4

Remove-PnPUser -Identity i:0#.f|membership|user@tenant.onmicrosoft.com -Force:$false

Remove the user with LoginName i:0#.f|membership|user@tenant.onmicrosoft.com from the User Information List of the current site collection without asking to confirm the removal first

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Force

Specifying the Force parameter will skip the confirmation question

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Identity

User ID or login name

Type: UserPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

Microsoft 365 Patterns and Practices