Table of Contents

Remove-PnPWeb

SYNOPSIS

Removes a subsite. Important:The subsite is permanently deleted without being sent to the recycle bin, the action cannot be undone, and this cmdlet should be used with extreme caution

SYNTAX

Remove-PnPWeb -Identity <WebPipeBind> [-Force] [-Connection <PnPConnection>] 

DESCRIPTION

This cmdlet removes the specified subsite.

EXAMPLES

EXAMPLE 1

Remove-PnPWeb -Identity projectA

Removes the subsite called projectA and will ask for confirmation before doing so.

EXAMPLE 2

Remove-PnPWeb -Identity 5fecaf67-6b9e-4691-a0ff-518fc9839aa0

Removes the subsite with the provided Id and will ask for confirmation before doing so.

EXAMPLE 3

Get-PnPSubWeb | Remove-PnPWeb -Force

Removes all subsites while not asking for confirmation to do so.

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

Do not ask for confirmation to delete the subweb.

Type: SwitchParameter
Parameter Sets: (All)

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

-Identity

The identifier of a subsite, the subsite instance or name of the subsite.

Type: WebPipeBind
Parameter Sets: (All)

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

Microsoft 365 Patterns and Practices