Hi @Carl94580345,
To find and rename invalid names in SharePoint Online, you can use PowerShell.Here's an example PowerShell script that renames all items with invalid names in a SharePoint Online site:
# Connect to SharePoint Online
Connect-PnPOnline -Url https://yourtenant.sharepoint.com/sites/yoursite
# Get all list items
$items = Get-PnPListItem -List "Your List Name"
# Define regular expression to match invalid characters
$regex = '[\\\/\:\*\?\"\<\>\|\#]'
# Loop through each item and rename if necessary
foreach ($item in $items) {
if ($item.FieldValues.FileLeafRef -match $regex) {
$newName = $item.FieldValues.FileLeafRef -replace $regex, ""
Set-PnPListItem -List "Your List Name" -Identity $item.Id -Values @{FileLeafRef=$newName}
}
}
Replace "Your List Name" with the name of the list or library you want to rename items in. You may also need to modify the regular expression to match the specific invalid characters in your environment.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.