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? https://msdn.microsoft.com/en-us/library/office/microsoft.online.sharepoint.tenantadministration.siteprope...
Michael Schau
May 18, 2017Copper Contributor
Well, it was added to CSOM a year ago, so I just assumed it was supported by now.
https://dev.office.com/blogs/new-sharepoint-csom-version-released-for-Office-365-march-2016
The property also exists in the SharePoint Online documentation.
Deleted
May 18, 2017how do you build the context with creds etc?
a example of mine
SharePointService sharePointService = new SharePointService(); AuthenticationManager authenticationManager = new AuthenticationManager(); using ( ClientContext adminContext = authenticationManager.GetSharePointOnlineAuthenticatedContextTenant(Info.TenantAdminUri.AbsoluteUri, Info.UserName, Info.UserPassWord)) { adminContext.RequestTimeout = Timeout.Infinite; }
hope it helps
- Michael SchauMay 19, 2017Copper Contributor
I've tried both AppOnly context with full SiteCollection permissions and SharePointOnlineContext.
Neither works.
I can however create/delete sitecollections and change other properties, but NewUrl doesn't work. So I believe my context is ok.
Deleted you're saying that it works for you? My ServerLibraryVersion is 16.0.6511.1201.
- DeletedMay 19, 2017
Hi I am just checking your code.
What are you trying to accomplish?
Since i see you get the url then want to update the url??
That will not work.
- Michael SchauMay 19, 2017Copper Contributor
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?