Forum Discussion
Michael Schau
May 18, 2017Copper Contributor
SiteProperties.NewUrl not working
Has anyone had any luck changing the SiteCollection url in SharePoint Online using CSOM?
Here's a code sample (using OfficedDevPnP extensions)
var tenant = new Tenant(context); var siteProperties = tenant.GetSitePropertiesByUrl("<CurrentUrl>", false); tenant.Context.Load(siteProperties); tenant.Context.ExecuteQueryRetry(); siteProperties.NewUrl = "<NewUrl>"; siteProperties.Update(); tenant.Context.ExecuteQueryRetry();
I get an ArgumentException with the following message
The requested operation is not supported for site: <SiteUrl>
- Deleted
what is the context when you add
var tenant=tenant(context) ??
- Michael SchauCopper Contributor
It is the Tenant Admin context.
Eg. <myurl>-admin.sharepoint.com
Is this something new? So far this has not been supported...adding VesaJuvonen to comment on this