SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web application using host named site collections. I set it up using HTTP, later on I figured to use HTTP. I changed the AAM to use HTTPS as default and HTTP as Intranet Zone. Everything is working fine so far - I can access the sites using HTTPS as well as HTTP.

Unfortunately some standard web parts take the URL of the default Zone of the sites. Here comes the problem:

>> Get-SPSiteURL

Url                                                                        Zone
---                                                                        ----                                         Default                                       Extranet

So the default is HTTP. I cannot change the default zone URL using Set-SPSiteUrl and have to use SPSite.Rename. No problem:

>> Remove-SPSiteUrl
>> $site = get-spsite
>> $site.Rename("")
>> Set-SPSiteUrl -Identity -Url -Zone Intranet

Again, no errors. And checking the URLs again I get this:

>> Get-SPSiteUrl

Url                                                                        Zone
---                                                                        ----                                           Intranet                                          Default

Perfect! (mind the order it's the other way around?) But here comes the problem. I cannot access the site anymore using HTTPS, I get access denied errors as well as these System.ArgumentException with encodedValuein the ULS log, see the relevant excerpt of the log here: I'm using Windows Authentication (NTLM), not forms.

I can change the URL back with no problem using the same process as described above and everything starts working again, only with the wrong URL in the default zone.

  1. What am I doing wrong?
  2. How can I change a HNSC (host named site collection) default zone URL from HTTP to HTTPS?
  3. How can I change all site collections beneath the HNSC including a managed path (in this case it is /community/communitysite1, /community/communitysite2, ...) to have a default zone URL with HTTPS?

If all else fails, how can I backup the sites and restore them at a new location, but again with HNSC? I would like to use the suggested way of using .Rename().

Disclaimer: I also posted to MSDN Forums and will update with a solution if its found there.

share|improve this question
In the AAM settings you have HTTPS for default Zone? – ReTech Sep 25 '13 at 9:08
Yes, I extended the HSNC web application to HTTPS and changed the AAM mappings to the HTTPS URL is default, HTTP is Intranet. – Dennis G Sep 25 '13 at 20:12
up vote 2 down vote accepted

Apparently it is not possible to switch to HTTPS after setting up the root HNSC web application without SSL (-SecureSocketsLayer parameter) - see "SPSite.Rename not working from HTTP to HTTPS (HNSC)".

The solution: You will have to delete the existing HSNC web application (make sure to not delete the content databases[!!!]) and recreate it with the -SecureSocketsLayer parameter in PowerShell. Afterwards you can change all the contained site collections with Move-SPSite and move them to the new https based location. Maybe you will also want to add HTTP back to the sites for which you can use Set-SPSiteURL.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.