Remove-SPOSite
Sends a SharePoint Online site collection to the SharePoint Online Recycle Bin.
Syntax
Default (Default)
Remove-SPOSite
-Identity <SpoSitePipeBind>
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-SPOSite
cmdlet does not delete a site collection from the site collections list permanently.
Instead, the removed site collection is moved to the Recycle Bin.
You can use the Restore-SPODeletedSite
cmdlet to restore a site collection from the Recycle Bin.
To delete a site collection permanently, first move the site collection to the Recycle Bin by using the Remove-SPOSite
cmdlet and then delete it from the Recycle Bin by using the Remove-SPODeletedSite
cmdlet.
You must be at least a SharePoint Online administrator and be a site collection administrator to run the cmdlet.
For permissions and the most current information about Windows PowerShell for SharePoint Online, see the online documentation at Intro to SharePoint Online Management Shell.
Examples
EXAMPLE 1
Remove-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -NoWait
This example immediately removes the site collection named https://contoso.sharepoint.com/sites/site1 from the site collections list and moves it to the Recycle Bin.
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 |
-Identity
Applicable: SharePoint Online
Specifies the URL of the site collection to remove.
Parameter properties
Type: | Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-NoWait
Applicable: SharePoint Online
Specifies to continue executing script immediately.
Parameter properties
Type: | System.Management.Automation.SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
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.