Move-SPPItem

Top  Previous  Next

Moves SharePoint list items, documents and folders with full fidelity to any destination list folder within the same SharePoint farm. Items can be moved across all boundaries in SharePoint including site collections and Web applications.

Syntax

Move-SPPItem [-Source] <SPObjectPipeBind> [-Target] <SPObjectPipeBind> [-ContentTypeMappings <string[]>] [-DisableTransactionLimits <SwitchParameter>] [-ExcludePermissions <SwitchParameter>] [-ExcludeProperties <string[]>] [-ExcludeTimeStamps <SwitchParameter>] [-ExcludeUsers <SwitchParameter>] [-ExcludeVersions <SwitchParameter>] [-FileExistAction <string>] [-IgnoreWarnings <SwitchParameter>] [-Item <string[]>] [-PropertyMappings <string[]>] [-Recursive <SwitchParameter>] [<CommonParameters>]

Parameters

Parameter

Required

Type

Description

Source

Yes

SPObjectPipeBind

SharePoint source location. Possible values:

SPFile or SPListItem object to move.
SPFolder object to move specified items from. Use the Item option to specify one or more items.
String object with the absolute URL address of the SPFile or SPListItem object to move.
String object with the absolute URL address of the SharePoint list folder to move items from. Use the Item option to specify one or more items.

Target

Yes

SPObjectPipeBind

SharePoint destination location. Possible values:

SPFile object to move to.
SPFolder object to move specified items to. Use the Item option to specify one or more items.
String object with the absolute URL address of the SPFile object to move to.
String object with the absolute URL address of the SharePoint list folder to move items to. Use the Item option to specify one or more items.

Item

No

String Array

Array of source items to move. The items can be specified by their URL, integer id or Guid. The URLs can be folder relative, site relative or server relative. Finally, it is also possible to include simple wildcards like * and *.* and *.pdf and *partialfilename*. Specify the Recursive switch parameter to also apply the wildcard(s) to items in sub folders.

ContentTypeMappings

No

String Array

Array of strings with content type mappings in the format; SourceName:TargetName or SourceId:TargetId

List item content types are in turn mapped as specified on all moved items.

PropertyMappings

No

String Array

Array of strings with property mappings in the format; SourceName:TargetName

List item fields and property bag entries are in turn mapped as specified on all moved items.

ExcludeProperties

No

String Array

Array of strings with the internal names of metadata properties and fields to exclude on all moved items.

FileExistAction

No

String

Action on existing files in the destination. Possible values:

Overwrite: Replace any existing documents. Use the IgnoreWarnings switch to continue moving on file overwrite warnings.
Rename: Preserve any existing documents and move with a new file name.
Skip: Preserve any existing documents and skip moving documents with the same file names.

Default action is Overwrite.

IgnoreWarnings

No

SwitchParameter

Do not abort the move operation on any validation warnings detected before items are moved.

ExcludePermissions

No

SwitchParameter

Do not preserves any item level permissions on the moved items. Inherited permissions are not preserved.

ExcludeTimeStamps

No

SwitchParameter

Do not preserve the item created time and item last modified time on the moved items.

ExcludeUsers

No

SwitchParameter

Do not preserve the item created by user and item last modified by user on the new moved items.

ExcludeVersions

No

SwitchParameter

Preserves the complete version history on the copied items. Requires the destination list to have the same versioning settings as the source list.

Recursive

No

SwitchParameter

Applies any specified item wildcard(s) recursively to items in sub folders.

DisableTransactionLimits

No

SwitchParameter

Disables the CopyMove transaction limits for the total item count and the total item size in MB that can be moved in one transaction. Use this switch when moving large lists and libraries that exceed the transaction limits configured on the global CopyMove settings page in Central Administration. However, the transaction may as a result take a long time to complete and consume a significant amount of memory.

Examples

Move a single file with default options.

Move-SPPItem "https://teams.mydomain.net/sites/site1/docs/document.ext" "https://teams.mydomain.net/sites/site2/docs/document.ext"

Move a single file and ignore warnings like the file overwrite warning.

Move-SPPItem "https://teams.mydomain.net/sites/site1/docs/document.ext" "https://teams.mydomain.net/sites/site2/docs/document.ext" -IgnoreWarnings

Move a single file and rename it on the destination.

Move-SPPItem "https://teams.mydomain.net/sites/site1/docs/document.ext" "https://teams.mydomain.net/sites/site2/docs/newdocument.ext"

Move two documents by filename.

Move-SPPItem
 -Source "https://teams.mydomain.net/sites/site1/Shared Documents"
 -Target "https://teams.mydomain.net/sites/site2/Shared Documents"
 -Item "Document.docx","Presentation.pptx"

Move three documents by list item id.

Move-SPPItem
 -Source "https://teams.mydomain.net/sites/site1/Shared Documents"
 -Target "https://teams.mydomain.net/sites/site2/Shared Documents"
 -Item 432,736,789

Move PDF files by a single wildcard.

Move-SPPItem "https://teams.mydomain.net/sites/site1/docs/*.pdf" "https://teams.mydomain.net/sites/site2/docs"

Recursively move files by mutliple wildcards..

 

Move-SPPItem
 -Source "https://teams.mydomain.net/sites/site1/Shared Documents"
 -Target "https://teams.mydomain.net/sites/site2/Shared Documents"
 -Item *.docx,*.pptx

 -Recursive