Restore-SPDeletedSite

還原已刪除的網站集合。

Syntax

Restore-SPDeletedSite
       [-Identity] <SPDeletedSitePipeBind>
       [-AssignmentCollection <SPAssignmentCollection>]
       [-Confirm]
       [-ContentDatabase <SPContentDatabasePipeBind>]
       [-WebApplication <SPWebApplicationPipeBind>]
       [-WhatIf]
       [<CommonParameters>]

Description

此 Cmdlet 在具有 Service Pack 1 (SP1) 的 SharePoint Server 和具有 Service Pack 1 (SP1) 的 SharePoint Foundation 中導入。

使用 Cmdlet Restore-SPDeletedSite 還原先前刪除的網站集合。

不同于 Restore-SPSite 使用 Identity 參數主機名稱和配置的 Cmdlet (也就是 https://server_name) ,所有 SPDeletedSite Cmdlet 的識別參數值都會使用伺服器相對 URL。 一般而言,/) (正斜線字元會開始相對 URL,同時也代表根網站。

如需伺服器相對 URL 的其他資訊,或瞭解有關絕對和相對 URL 的一般概念,請參閱伺服器相對 URL 屬性 (https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.serverrelativeurl.aspx) 或瞭解絕對和相對 URL 位址 (https://msdn.microsoft.com/en-us/library/bb208688(office.12).aspx) 。

如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

----------------------範例 1----------------------

$deletedSite = Get-SPDeletedSite /sites/site_name
Restore-SPDeletedSite -Identity $deletedSite

此範例使用網站 ID 還原特定的已刪除網站集合。

參數

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Confirm

在執行命令之前,提示您確認操作。 如需詳細資訊,請輸入下列命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ContentDatabase

Specifies the SQL Server content database where the site collection data will be stored. If no content database is specified, the content database with the greatest unused site collection capacity and whose database status is ready will be used.

Type:SPContentDatabasePipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定要還原的已刪除網站集合身分識別。 身分識別可以是 /sites/site_name 格式的有效伺服器相對 URL;格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;或 SPDeletedSite 物件。

網站集合不可位於要執行還原的 URL 位置。

Type:SPDeletedSitePipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WebApplication

指定網站列示所在的 URL、GUID 或 Web 應用程式名稱。

此類型必須是有效的 URL (格式為 https://server_name、有效的 GUID (例如,12345678-90ab-cdef-1234-567890bcdefgh) 或 Web 應用程式名稱 (例如,WebApplication1212)。

Type:SPWebApplicationPipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition