Export-SPWeb
匯出網站、清單或文件庫。
Syntax
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>]
Description
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
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-AssignmentCollection
管理物件以適當處置它們。 使用 SPWeb 或 SPSite 等物件可能會耗用大量的記憶體,因此在 Windows PowerShell 指令碼中使用這些物件時,必須適當地管理記憶體。 您可以使用 SPAssignment 物件將物件指派給變數,並在不需要時處置這些物件,以釋放記憶體。 使用 SPWeb、SPSite 或 SPSiteAdministration 物件時,若未使用指派集合或 Global 參數,將會自動處置這些物件。
使用 Global 參數時,所有物件會包含在全域儲存區內。 若未立即使用物件,或未使用 Stop-SPAssignment 命令處置物件,將會發生記憶體不足的狀況。
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-CompressionSize
設定壓縮匯出檔案的大小上限。 若匯出封裝的總大小大於此大小,匯出的封裝即會被分割成多個檔案。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Confirm
在執行命令之前,提示您確認操作。
如需詳細資訊,請輸入下列命令:get-help about_commonparameters
。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Force
強制覆寫既存的匯出封裝。
此類型必須是下列其中一個值:
-真
-假
預設值為 False。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-HaltOnError
發生錯誤時停止匯出程序。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-HaltOnWarning
發生警告時停止匯出程序。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Identity
指定要匯出的網址或 GUID。
此類型必須是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID、有效的 SharePoint 網站名稱 (例如 MySPSite1),或有效之 SPWeb 物件的執行個體。
Type: | SPWebPipeBind |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-IncludeAlerts
指出警示是否已開啟。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2016, SharePoint Server 2019 |
-IncludeUserSecurity
保留使用者安全性設定。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-IncludeVersions
指出應該併入匯出作業的檔案和清單項目版本歷程記錄類型。 若無 IncludeVersions 參數,Export-SPWeb Cmdlet 預設會使用值 1 。
此類型必須是下列任一版本:
- 檔案和清單項目的上一個主要版本 (預設值)
- 目前版本 (上一個主要版本或上一個次要版本)
- 檔案和清單項目的上一個主要版本和上一個次要版本
- 檔案和清單項目的所有版本
有效值為:
All、CurrentVersion、LastMajor、LastMajorAndMinor
Type: | SPIncludeVersions |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ItemUrl
指定要匯出的 Web 應用程式 URL、GUID 或物件。
類型必須是有效的 URL;例如, https://server_name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-NoFileCompression
啟用或停用匯出封裝中的檔案壓縮。 匯出封裝會儲存在 Path 參數或 Identity 參數所指定的資料夾內。 基於效能的考量,建議使用此參數。 若啟用壓縮功能,匯出程序的速度約可加快 30%。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-NoLogFile
不產生匯出記錄檔。 若不指定此參數, Export-SPWeb Cmdlet 會產生匯出記錄檔,與匯出封裝位於相同的位置。 此記錄檔使用統一登入服務 (ULS)。
建議使用此參數。 但是,基於效能考量,您可能不想產生記錄檔。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-Path
指定匯出檔案的名稱。
若使用 NoFileCompression 參數,即必須指定目錄,否則所有檔案格式皆屬有效。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-UseSqlSnapshot
指定在匯出程序開始時建立 SQL 資料庫快照集,而且直接從資料庫快照集中擷取所有的匯出資料。 當匯出完成時,會自動刪除此快照集。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-WhatIf
顯示訊息會描述命令的功效而不執行命令。
如需詳細資訊,請輸入下列命令:get-help about_commonparameters
。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |