Export-SPWeb

导出网站、列表或库。

语法

Default (默认值)

Export-SPWeb
    [-Identity] <SPWebPipeBind>
    -Path <String>
    [-AppLogFilePath <String>]
    [-AssignmentCollection <SPAssignmentCollection>]
    [-CompressionSize <Int32>]
    [-Confirm]
    [-Force]
    [-HaltOnError]
    [-HaltOnWarning]
    [-IncludeUserSecurity]
    [-IncludeVersions <SPIncludeVersions>]
    [-ItemUrl <String>]
    [-NoFileCompression]
    [-NoLogFile]
    [-UseSqlSnapshot]
    [-WhatIf]
    [-IncludeAlerts]
    [<CommonParameters>]

说明

Export-SPWeb cmdlet 导出网站、列表或库。 从库导出的功能是 SharePoint 中的一项新功能。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

例。

Export-SPWeb https://site -Path "C:\Temp\export.cmp"

此示例将位于 https://site/ 的网站导出到当前目录中名为 site export.cmp 的文件。

参数

-AppLogFilePath

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AssignmentCollection

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。

在使用 Global 参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。

参数属性

类型:SPAssignmentCollection
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-CompressionSize

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

设置压缩的导出文件的最大文件大小。 如果导出的包的总大小大于该大小,则导出的包将被拆分为多个文件。

参数属性

类型:Int32
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Confirm

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

执行命令前,看到确认提示。 有关详细信息,请键入以下命令:get-help about_commonparameters

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Force

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

如果导出的包已经存在,则强制覆盖它。

键入的值必须为以下某个值:

-真

-假

默认值为 False。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-HaltOnError

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

出现错误时停止导出过程。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-HaltOnWarning

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

出现警告时停止导出过程。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Identity

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定要导出的 Web 的 URL 或 GUID。

键入的值必须为 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID;有效的 SharePoint 网站名称(如 MySPSite1);或有效 SPWeb 对象的实例。

参数属性

类型:SPWebPipeBind
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:1
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-IncludeAlerts

适用:SharePoint Server 2016,SharePoint Server 2019

指示警报是否已打开。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-IncludeUserSecurity

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

保留用户安全设置。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-IncludeVersions

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指示要在导出操作中包含的文件和列表项版本历史记录的类型。 如果缺少 IncludeVersions 参数,则 Export-SPWeb cmdlet 默认使用值 1 。

键入的值必须是下列任意一个版本:

- 文件和列表项的上一个主要版本(默认值)

- 当前版本,上一个主要版本或上一个次要版本

- 文件和列表项的上一个主要版本和上一个次要版本

- 文件和列表项的所有版本

有效值包含:

All、CurrentVersion、LastMajor、LastMajorAndMinor

参数属性

类型:SPIncludeVersions
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ItemUrl

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定要导出的 Web 应用程序、GUID 或对象的 URL。

类型必须是有效的 URL;例如 https://server_name.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-NoFileCompression

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

在导出包中启用或禁用文件压缩。 导出包存储在 Path 参数或 Identity 参数指定的文件夹中。 出于性能方面的考虑,建议您使用此参数。 如果启用压缩,则导出过程的速度可提高大约 30%。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-NoLogFile

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

禁止生成导出日志文件。 如果未指定此参数,则 Export-SPWeb cmdlet 将在导出包所在的位置生成导出日志文件。 该日志文件使用统一日志记录服务 (ULS)。

建议使用此参数。 但是,出于性能原因,您可能不想生成日志文件。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Path

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定导出文件的名称。

如果使用了 NoFileCompression 参数,则必须指定目录;否则,任何文件格式都有效。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-UseSqlSnapshot

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定在导出过程开始时将要创建的 SQL 数据库快照,将从该数据库快照中直接检索所有导出的数据。 导出完成时,将自动删除该快照。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

显示一条描述命令作用的消息,而不执行命令。 有关详细信息,请键入以下命令:get-help about_commonparameters

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:无线

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters