Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes AccessDenied error on site collection creation #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lkrn
Copy link

@lkrn lkrn commented Feb 14, 2018

If there are no IIS sites prior to SharePoint installation (e.g., "Default Web Site" was removed) then "SharePoint Web Services" IIS site will be created with ID = 1.
On new site collection creation, Stop-DefaultWebsite function wrongly assumes that IIS site with ID = 1 is the "Default Web Site" and stops it, which results in hard-to-debug issue (AccessDenied as SecurityTokenService is not available anymore).
If really needed I can write function to check IIS bindings for site with ID = 1, or at minimum, check if site name is "SharePoint Web Services", but imho it's kind of stupid to stop any site with ID = 1 (what if it's some business app or WebAPI which uses its own port and do not interfere with SP).

@brianlala
Copy link
Owner

What about localized versions of IIS? In those cases, is the default web site still called "Default Web Site" ? I believe that's why I originally included the site ID as well.

@lkrn
Copy link
Author

lkrn commented Feb 24, 2018

In those cases, is the default web site still called "Default Web Site" ?

Maybe not, but I'm pretty sure its physicalPath property will still have wwwroot directory no matter which language is used for IIS.

@lkrn
Copy link
Author

lkrn commented Feb 24, 2018

Added check for http binding for website with ID=1.
Removed useless Name check due to potential issue with localized versions of IIS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants