Restore-SPDeletedSite

还原网站集。

语法

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

说明

此 cmdlet 在 SharePoint Server 中引入了 Service Pack 1 (SP1) 和 SharePoint Foundation,其中包含 Service Pack 1 (SP1) 。

Restore-SPDeletedSite使用该 cmdlet 还原以前删除的网站集。

Restore-SPSite与使用标识参数的主机名和方案的 cmdlet 不同, (https://server_name)即,所有 SPDeletedSite cmdlet 的标识参数的值使用相对于服务器的 URL。 通常,相对 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 还原特定的已删除网站集。

参数

-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

指定从其列出网站的 Web 应用程序的 URL、GUID 或名称。

键入的值必须是有效 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

-工作分配

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