These steps create the HNSC and then explain setting anonymous access:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
#Step 1, create the web application $applicationPool = "HNSC01ApplicationPool" $ServiceAcct = "BeaversOil\spprod_hnsc01" $WebApp = "SharePoint - 1001 - HNSC" $webAppURL = "https://hnsc01.BeaversOil.com" $contentDB = "SPPROD_WSS_Content_HNSC01" New-SPWebApplication -ApplicationPool $applicationPool -ApplicationPoolAccount $serviceAcct -Name $WebApp -URL $webAppURL -Port 1001 -databaseName $contentDB -securesocketslayer #Step 2, create the top site $primarySiteCollectionOwnerAcct = "BeaversOil\rBeaver" $PrimarySCOwnerEmail = "rBeaver@beaversoil.com" $webApp0URL = "https://hnsc01.beaversoil.com:1001" New-SPSITE -URL $webApp0URL -owneralias $primarySiteCollectionOwnerAcct -owneremail $PrimarySCOwnerEmail -Template STS#1 #Step 3, create a separate database for the first HNSC $HNSC3DB = "SPDEV_WSS_Content_BeaversOil" $webApp0URL = "https://hnsc01.beaversoil.com:1001" New-SPContentDatabase $HNSC3DB –WebApplication $webApp0URL #Step 4, create the first HNSC $primarySiteCollectionOwnerAcct = "beaversoil\ssimpkins" $PrimarySCOwnerEmail = "stacy.simpkins@beaversoil.com" $HNSC3Name = "Test Site" $HNSC3URL = "https://GetInto.beaversoil.com" $HNSC3DB = " SPDEV_WSS_Content_BeaversOil " $webApp0URL = "https://hnsc01.beaversoil.com:1001" New-SPSite -url $HNSC3URL -Name $HNSC3Name -hostheaderwebapplication $WebApp0URL -ownerAlias $PrimarySiteCollectionOwnerAcct -owneremail $PrimarySCOwnerEmail -contentDatabase $HNSC3DB -Template STS#0 |
Step 5, Enable Anonymous access
Turn anonymous on under Authentication for the default zone assuming you followed the advice above. If in a different zone then adjust accordingly.
Turn on the anonymous policy for deny write
At the site level, navigate to _layouts/user.aspx and enable anonymous for the entire web site.