Okay, we know not to try to browse to web applications with non-standard host headers from the server because the loop back restrictions Windows places on us. Here, they explain that we can hack the registry to eliminate the problem but that’s not really necessary for our purposes now.

So let’s look at the SMS command for our new web application:

New-SPWebApplication
-Name "Contoso Internet Site"
-Port 80
-HostHeader sharepoint.contoso.com
-URL https://www.contoso.com
-ApplicationPool ContosoAppPool
-ApplicationPoolAccount (Get-SPManagedAccount MyServer\Administrator)

Now, I’ve added line breaks for readability so we’ll have to delete them to make it work. I’ve also created the managed account on Central Admin’s Security | Configure Managed Accounts.

It runs for a minute and I get a return of:

DisplayName               Url
-----------               ---
sharepoint.contoso.com    http://www.contoso.com

Now, I can’t browse to it locally, but I can from another computer. Of course, there will be an issue with DNS, but I added www.contoso.com to my hosts file and pointed it to the SharePoint server.

So I browse to the site and I get prompted to login, but then I get The webpage cannot be found. This makes sense because there’s no site collection installed there yet. When we did this interactively in CA, it gave us a popup window that told us to go create a site collection.

Let’s go back to CA and look at Application Management | Manage Web Applications and you’ll see the new web application listed. What we need to do is go back to the Application Management pages and click Create Site Collections. Here, our new web application will appear in the web app pull down; if not, pull it down and select the new web app. We give it a name, select a template, specify an owner and click OK. After it processes, we can get a link to our new site collection’s home page. Click it and it will prompt us to login and there it is.

We can back out by moving to the Application Management page and, in the Delete a Site Collection. Pull down the Site Collection pick list and click on Change Site Collection. Here, we get another pull down to select the site collection we just created. Now, we also get an option to select any additional site collection we may have created in the selected web application. When we can click OK, we go back to the delete page and we click Delete. We get a dialog box to confirm and click OK.

We go back to the Application Management page and we can click on Manage Web Applications, select our web application and click Delete. This time we get a DHTML popup where we dot the options to delete the content database and the IIS web site and click Delete and then OK on the confirmation popup.

So, next, what we want to do is add to our new web app command to allow anonymous access and then we’ll add the command to create the site collection creating our first SMS script to do both at once. Then we’ll do another script to work the delete.

 hth!

-robot


Tags:

 
 
 

Comments are closed.