Forum Discussion
SiteProperties.NewUrl not working
Yes, I want to update the url. I'm creating a "buffer" of site collections and want to give them a proper url when they're taken into use.
If that doesn't work, then what is the usage of NewUrl?
Why is it available? Is it because is only works on premises?
Hi Michael Schau,
I just tried this with PnP PowerShell/CSOM and I'm finding the same results as you.
I had a bit of a further play with this where I tried setting NewUrl to ServerRelativeUrls or just setting it to the site specific part of the Url but this gave me just different errors. I would expect that as you can only update the site specific bit that you might not include the full url, but unfortenately that didn't work.
I thnk you might be right that this only works in on premises environments.
- DeletedMay 19, 2017
Just checked with reflector code is implemented but can not debug it :-(
- Michael SchauMay 19, 2017Copper Contributor
Yep, I've read it.
But as mentioned it was posted more than a year ago. Just assumed that it was funtioning in "Production" by now.
- May 19, 2017
Hi Deleted,
I tried this:
$site = Get-PnPTenantSite https://Mytenant.sharepoint.com/sites/testsite
$site.NewUrl = "https://Mytenant.sharepoint.com/sites/testsite2"
$site.Update()
$site.Context.ExecuteQuery()
and then I tried all variations of Urls for the $site.NewUrl = ""
- DeletedMay 19, 2017
have you read this?
public property Microsoft.Online.SharePoint.TenantAdministration.SiteProperties.NewUrl - The new URL for the site (updating this will trigger a site rename). Notice. This is not yet functional in the production when this blog post was written
https://dev.office.com/blogs/new-sharepoint-csom-version-released-for-Office-365-march-2016