Im trying to rename a site collection by changing the url by using this PowerShell
$site = get-spsite -identity http://xxx:9000/sites/SCOne
$site.Rename("http://xxx:9000/sites/SCOneNew")
I got this message
Exception calling "Rename" with "1" argument(s): "Cannot rename a site collection with recycled items. Empty the site recycle bin of site collectio
The recycle bin is empty now but I still can't rename and I get the same message.
I have tried this PowerShell to get count of items in recycle bin
$site = get-spsite http://xxx:9000/sites/SCOne
Write-Host $site.RecycleBin.Count.ToString();
but it says
you cannot call a method on a null-valued expression
http://xxx:9000/sites/SCOne
. Also, the.ToString()
is not necessary