Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
external help file: Microsoft.Online.SharePoint.PowerShell.dll-Help.xml
Module Name: Microsoft.Online.SharePoint.PowerShell
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/find-spocrosstenantlongfilepathsforsiterename
schema: 2.0.0
author: vgaddam-pm
ms.author: vgaddam
ms.reviewer: jmcdowe
---

# Find-SPOCrossTenantLongFilePathsForSiteRename

## SYNOPSIS

Finds sites that exceed the 400 character limit for Cross Tenant User Migration moves.
Copy link
Copy Markdown
Contributor

@samkabue samkabue Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrite agent suggestion:

Identify sites with file paths over 400 characters for cross-tenant user migration.

update in Microsoft.Online.SharePoint.PowerShell.md as well #Closed


## SYNTAX

```
Find-SPOCrossTenantLongFilePathsForSiteRename
[-OldSiteUrl <String>]
[-NewSiteUrl <String>]
[<CommonParameters>]
```

## DESCRIPTION
SharePoint Cross Tenant User Migration has a restriction where the source tenant site's file path should not exceed 400 characters in length after merging to the target side. This cmdlet finds sites that exceed the 400 character limit.
Copy link
Copy Markdown
Contributor

@samkabue samkabue Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion from Rewrite agent:

During SharePoint cross-tenant user migration, file paths from the source tenant must be 400 characters or fewer after merging with the target tenant. This cmdlet helps you identify sites that exceed this limit. #Closed


## EXAMPLES

### Example 1
```powershell
PS C:\Users\vmadministrator> $SourceSiteUrl = "https://prepspo.spgrid.com/sites/CommTest1"
PS C:\Users\vmadministrator> $TargetSiteUrl = "https://Tenanta24a16f05d204f3bafbfd10ceb259ab9.spgrid.com/sites/CommTest1_longerUrlFor400CharsLimitation"
PS C:\Users\vmadministrator> Find-SPOCrossTenantLongFilePathsForSiteRename -OldSiteUrl $SourceSiteUrl -NewSiteUrl $TargetSiteUrl
```
Output:

List of internal components with too long paths for Cross-tenant migration of the source site [https://prepspo.spgrid.com/sites/CommTest1]
into the target relative url [/sites/CommTest1_longerUrlFor400CharsLimitation] with the relative delta [31]:

1) - sites/CommTest1/Shared Documents/Level1LongFolderNameFor400CharLimitValidationTesting/Level2LongFolderNameFor400CharLimitValidationTesting/Level3LongFolderNameFor400CharLimitValidationTesting/Level4LongFolderNameFor400CharLimitValidationTesting/Level5LongFolderNameFor400CharLimitValidationTesting/Level6LongFolderNameFor400CharLimitValidationTesting/Level7LongFolderNameFor400CharLimit/a.txt
2) - sites/CommTest1/Shared Documents/Level1LongFolderNameFor400CharLimitValidationTesting/Level2LongFolderNameFor400CharLimitValidationTesting/Level3LongFolderNameFor400CharLimitValidationTesting/Level4LongFolderNameFor400CharLimitValidationTesting/Level5LongFolderNameFor400CharLimitValidationTesting/Level6LongFolderNameFor400CharLimitValidationTesting/Level7LongFolderNameFor400CharLimit

Copy link
Copy Markdown
Contributor

@samkabue samkabue Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • remove this entire output thing as we don't do this for other cmdlets. only example usage is sufficient.
  • also, use common public domains such as contoso and fabrikam -- prepspo is internal.
  • remove the "PS C:..." prefix

Simply use this example:

Find-SPOCrossTenantLongFilePathsForSiteRename -OldSiteUrl [https://contoso.sharepoint.com/sites/site1](https://contoso.sharepoint.com/sites/site1) -NewSiteUrl [https://fabrikam.sharepoint.com/sites/site1](https://fabrikam.sharepoint.com/sites/site1)

#Closed

### Example 2

```powershell
PS C:\Users\vmadministrator> $SourceSiteUrl = "https://prepspo.spgrid.com/sites/CommTest1"
PS C:\Users\vmadministrator> $TargetSiteUrl = "https://Tenanta24a16f05d204f3bafbfd10ceb259ab9.spgrid.com/sites/CommTest1_longer"
PS C:\Users\vmadministrator> Find-SPOCrossTenantLongFilePathsForSiteRename -OldSiteUrl $SourceSiteUrl -NewSiteUrl $TargetSiteUrl
```
Output:

List of internal components with too long paths for Cross-tenant migration of the source site [https://prepspo.spgrid.com/sites/CommTest1]
into the target relative url [/sites/CommTest1_longer] with the relative delta [7]:

No problem found
Copy link
Copy Markdown
Contributor

@samkabue samkabue Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this example is not needed and can be removed #Closed


## PARAMETERS

### -NewSiteUrl
This parameter includes the source site URL
Copy link
Copy Markdown
Contributor

@samkabue samkabue Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL

end sentences with . #Closed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you rewrite this for clarity? "includes the source site URL" is not clear -- what does "include" mean in this context? same for the OldSiteUrl


```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -OldSiteUrl
This parameter includes the target site URL
Copy link
Copy Markdown
Contributor

@samkabue samkabue Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL

end sentences with . #Closed


```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### None

## OUTPUTS

### System.Object
## NOTES

## RELATED LINKS
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ Export user information from site user information list.
### [Export-SPOUserProfile](Export-SPOUserProfile.md)
Export user profile data to csv file.

### [Find-SPOCrossTenantLongFilePathsForSiteRename](Find-SPOCrossTenantLongFilePathsForSiteRename.md)
Finds sites that exceed 400 character limit for Cross Tenant User Migration moves.

### [Get-FileSensitivityLabelInfo](Get-FileSensitivityLabelInfo.md)
Extracts and displays the sensitivity label related information attached to an office file stored in SharePoint.

Expand Down