|
| 1 | +--- |
| 2 | +external help file: sharepointonline.xml |
| 3 | +Module Name: Microsoft.Online.SharePoint.PowerShell |
| 4 | +online version: https://learn.microsoft.com/powershell/module/sharepoint-online/copy-spopersonalsitepage |
| 5 | +applicable: SharePoint Online |
| 6 | +title: Copy-SPOPersonalSitePage |
| 7 | +schema: 2.0.0 |
| 8 | +author: xuyangzo |
| 9 | +ms.author: xuyangzou |
| 10 | +ms.reviewer: |
| 11 | +--- |
| 12 | + |
| 13 | +# Copy-SPOPersonalSitePage |
| 14 | + |
| 15 | +## SYNOPSIS |
| 16 | + |
| 17 | +This cmdlet command allows you to relocate existing SharePoint pages by utilizing an existing copy operation. We will also copy any assets associated with the SharePoint pages to the new destination. We offer two methods for relocating pages: |
| 18 | +- Copy: This method keeps the original page intact while creating a duplicate at the new location. |
| 19 | +- Move: This method creates a new copy at the new location and deletes the original page from the source. |
| 20 | + |
| 21 | +## SYNTAX |
| 22 | + |
| 23 | +```powershell |
| 24 | +Copy-SPOPersonalSitePage -SourceSite <SpoSitePipeBind> -DestinationSite <SpoSitePipeBind> -PageName <String> -DeleteSourcePage <SwitchParameter> [-Confirm] [<CommonParameters>] |
| 25 | +``` |
| 26 | + |
| 27 | +## DESCRIPTION |
| 28 | + |
| 29 | +The Copy-SPOPersonalSitePage cmdlet allows a SharePoint Administrator to copy one or more SharePoint pages from a selected source to a chosen destination SharePoint site. If the `-DeleteSourcePage` parameter is set to `$true`, the source page(s) will be deleted after the copy operation, effectively moving the page(s). |
| 30 | + |
| 31 | +> [!NOTE] |
| 32 | +> This cmdlet may not be available in all tenants as the feature rollout could be in progress. If the feature has not been enabled in your tenant, attempting to run this cmdlet will result in an error. |
| 33 | +
|
| 34 | +**Where can I move the existing page(s) to and from?** |
| 35 | + |
| 36 | +| Source | Destination | |
| 37 | +| :------------------- | :---------- | |
| 38 | +| SharePoint pages library in OneDrive for Business | SharePoint pages library in OneDrive for Business | |
| 39 | +| SharePoint pages library in OneDrive for Business | SharePoint site | |
| 40 | +| SharePoint site | SharePoint site | |
| 41 | + |
| 42 | +**How do I query the status of my copy operation?** |
| 43 | + |
| 44 | +After this cmdlet is executed, you'll receive the following information: |
| 45 | + |
| 46 | +| Property | Description | |
| 47 | +| :------- | :---------- | |
| 48 | +| ErrorMessage | We will show the corresponding error message, if any error occurs. | |
| 49 | +| JobState | The current state of the job. | |
| 50 | +| NewPageUrl | The URL of the new page if the copy operation has completed. | |
| 51 | +| SourcePageName | The name of the source page to be copied. | |
| 52 | +| StatusMessage | A message describing the current status. | |
| 53 | +| WorkItemId | The work item ID used to track the status of the copy job. If the copy operation is complete, this will be `00000000-0000-0000-0000-000000000000`. | |
| 54 | + |
| 55 | +- If the copy is successful, the URL for the new page will be provided. |
| 56 | +- If the copy is still in progress, you will receive the work item ID. You can use the [Get-SPOPersonalSitePageCopyProgress](./Get-SPOPersonalSitePageCopyProgress.md) command to check the status of the URL. |
| 57 | + |
| 58 | +The following table explains the copy job's state: |
| 59 | + |
| 60 | +| Status | Explanation | |
| 61 | +| :---------- | :---------- | |
| 62 | +| Queued | The copy operation was queued for execution. | |
| 63 | +| CreateAssetsFolderStart | We've started creating a folder to place all associated assets used on this page. | |
| 64 | +| CreateAssetsFolderEnd | We've finished creating a folder to place all associated assets used on this page. | |
| 65 | +| CopyAssetsStart | We've started copying associated assets used on this page. | |
| 66 | +| CopyAssetsEnd | We've finished copying associated assets used on this page. | |
| 67 | +| CreatePageStart | We've started creating a new page. | |
| 68 | +| CreatePageEnd | We've finished creating a new page. | |
| 69 | +| Succeeded | The copy operation was successful. | |
| 70 | +| Deleting | The copy operation was deleted. | |
| 71 | +| Failed | The copy operation failed. | |
| 72 | +| JobNotFound | The copy operation wasn't found. | |
| 73 | + |
| 74 | +## EXAMPLES |
| 75 | + |
| 76 | +### -----------------------EXAMPLE 1----------------------------- |
| 77 | + |
| 78 | +```powershell |
| 79 | +Copy-SPOPersonalSitePage -SourceSite 'https://contoso-my.sharepoint.com/personal/testuser_onmicrosoft_com' -DestinationSite 'https://contoso.sharepoint.com/sites/testsite' -PageName 'TestPage.aspx' -Confirm |
| 80 | +``` |
| 81 | + |
| 82 | +Example 1 demonstrates how a SharePoint Administrator can copy the SharePoint page named `TestPage.aspx` from `testuser`'s SharePoint pages library in OneDrive for Business to the `testsite` SharePoint site with confirmation. The source page will not be deleted. |
| 83 | + |
| 84 | +### -----------------------EXAMPLE 2----------------------------- |
| 85 | + |
| 86 | +```powershell |
| 87 | +Copy-SPOPersonalSitePage -SourceSite 'https://contoso-my.sharepoint.com/personal/testuser_onmicrosoft_com' -DestinationSite 'https://contoso.sharepoint.com/sites/testsite' -PageName 'TestPage.aspx' -DeleteSourcePage |
| 88 | +``` |
| 89 | + |
| 90 | +Example 2 demonstrates how a SharePoint Administrator can move the SharePoint page named `TestPage.aspx` from `testuser`'s SharePoint pages library in OneDrive for Business to the `testsite` SharePoint site. The source page will be deleted after the copy operation. |
| 91 | + |
| 92 | +### -----------------------EXAMPLE 3----------------------------- |
| 93 | + |
| 94 | +```powershell |
| 95 | +Copy-SPOPersonalSitePage -SourceSite 'https://contoso.sharepoint.com/sites/sourcesite' -DestinationSite 'https://contoso.sharepoint.com/sites/testsite' -PageName 'TestPage.aspx' -DeleteSourcePage -Confirm |
| 96 | +``` |
| 97 | + |
| 98 | +Example 3 demonstrates how a SharePoint Administrator can copy the SharePoint page named `TestPage.aspx` from a SharePoint site name `sourcesite` to the `testsite` SharePoint site with confirmation. The source page will be deleted after the copy operation. |
| 99 | + |
| 100 | +### -----------------------EXAMPLE 4----------------------------- |
| 101 | + |
| 102 | +```powershell |
| 103 | +Copy-SPOPersonalSitePage -SourceSite 'https://contoso-my.sharepoint.com/personal/testuser1_onmicrosoft_com' -DestinationSite 'https://contoso-my.sharepoint.com/personal/testuser2_onmicrosoft_com' -PageName 'TestPage.aspx' -DeleteSourcePage -Confirm |
| 104 | +``` |
| 105 | + |
| 106 | +Example 4 demonstrates how a SharePoint Administrator can move the SharePoint page named `TestPage.aspx` from `testuser1`'s SharePoint pages library in OneDrive for Business to `testuser2`'s SharePoint pages library in OneDrive for Business with confirmation. The source page will be deleted after the copy operation. |
| 107 | + |
| 108 | +## PARAMETERS |
| 109 | + |
| 110 | +### -SourceSite |
| 111 | + |
| 112 | +Specifies the URL of the source SharePoint site containing the SharePoint pages to copy. |
| 113 | + |
| 114 | +```yaml |
| 115 | +Type: SpoSitePipeBind |
| 116 | +Parameter Sets: (All) |
| 117 | +Aliases: |
| 118 | +Applicable: SharePoint Online |
| 119 | + |
| 120 | +Required: True |
| 121 | +Position: Named |
| 122 | +Default value: None |
| 123 | +Accept pipeline input: False |
| 124 | +Accept wildcard characters: False |
| 125 | +``` |
| 126 | +
|
| 127 | +### -DestinationSite |
| 128 | +
|
| 129 | +Specifies the URL of the destination SharePoint site where the SharePoint pages will be copied to. |
| 130 | +
|
| 131 | +```yaml |
| 132 | +Type: SpoSitePipeBind |
| 133 | +Parameter Sets: (All) |
| 134 | +Aliases: |
| 135 | +Applicable: SharePoint Online |
| 136 | + |
| 137 | +Required: True |
| 138 | +Position: Named |
| 139 | +Default value: None |
| 140 | +Accept pipeline input: False |
| 141 | +Accept wildcard characters: False |
| 142 | +``` |
| 143 | +
|
| 144 | +### -PageName |
| 145 | +
|
| 146 | +Specifies the name of the SharePoint page to copy. This parameter is required when not using the `-AllPages` switch. Note that `-PageName` refers to the name of a SharePoint page that ends with the suffix .aspx, such as page.aspx. |
| 147 | + |
| 148 | +```yaml |
| 149 | +Type: String |
| 150 | +Parameter Sets: (All) |
| 151 | +Aliases: |
| 152 | +Applicable: SharePoint Online |
| 153 | +
|
| 154 | +Required: True |
| 155 | +Position: Named |
| 156 | +Default value: None |
| 157 | +Accept pipeline input: False |
| 158 | +Accept wildcard characters: False |
| 159 | +``` |
| 160 | + |
| 161 | +### -DeleteSourcePage |
| 162 | + |
| 163 | +Indicates whether to delete the source SharePoint page(s) after copying. If specified, the operation will move the SharePoint page(s) instead of copying. |
| 164 | + |
| 165 | +```yaml |
| 166 | +Type: SwitchParameter |
| 167 | +Parameter Sets: (All) |
| 168 | +Aliases: |
| 169 | +Applicable: SharePoint Online |
| 170 | +
|
| 171 | +Required: True |
| 172 | +Position: Named |
| 173 | +Default value: None |
| 174 | +Accept pipeline input: False |
| 175 | +Accept wildcard characters: False |
| 176 | +``` |
| 177 | + |
| 178 | +### -Confirm |
| 179 | + |
| 180 | +Prompts for confirmation before executing the command. |
| 181 | +For more information, type the following command: `get-help about_commonparameters` |
| 182 | + |
| 183 | +```yaml |
| 184 | +Type: SwitchParameter |
| 185 | +Parameter Sets: (All) |
| 186 | +Aliases: cf |
| 187 | +Applicable: SharePoint Online |
| 188 | +
|
| 189 | +Required: False |
| 190 | +Position: Named |
| 191 | +Default value: None |
| 192 | +Accept pipeline input: False |
| 193 | +Accept wildcard characters: False |
| 194 | +``` |
| 195 | + |
| 196 | +### CommonParameters |
| 197 | + |
| 198 | +This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`, `-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). |
| 199 | + |
| 200 | +## Notes |
| 201 | + |
| 202 | +**Question: Will SharePoint pages retain their version history after the move?** |
| 203 | + |
| 204 | +Answer: Currently, only the latest published version will be transferred. |
| 205 | + |
| 206 | +**Question: Can recipients of SharePoint pages I shared with continue to access them after the move?** |
| 207 | + |
| 208 | +Answer: All permissions will be removed once the pages are moved. |
| 209 | + |
| 210 | +## RELATED LINKS |
| 211 | + |
| 212 | +[Getting started with SharePoint Online Management Shell](/powershell/sharepoint/sharepoint-online/connect-sharepoint-online) |
| 213 | + |
| 214 | +[Get-SPOPersonalSitePageCopyProgress.md](./Get-SPOPersonalSitePageCopyProgress.md) |
| 215 | + |
| 216 | +[Get-SPOSitePages.md](./Get-SPOSitePages.md) |
0 commit comments