Installing SharePoint 2016 – Part 4

This post is about Creating SSL Web Application, Setting up Personal Sites and OneDrive and Fast Site Collection Configuration

Creating SSL Web Applications

As we had ran the SharePoint Farm Configuration Wizard to setup this farm, a single web application was created on port 80. This is not that we want to do. Let’s re-create 3 web application

1. https://portal16.contoso.com

2. https://mysite16.contoso.com

3. https://sp2016bi2/

All of these web application will use singe application pool. As a first step I will I will delete the SharePoint – 80 web application. As we are creating 3 web applications I will be using PowerShell. I will delete the web application with Database Yes and Delete IIS Web Sites Yes.

clip_image002

Creating No Host Header Web Application. This web application is required if you want to use SharePoint Add-Ins. This web application does not use Host Header configuration. Portal and Mysite web application will use Host Header.

First I will create a new managed account for Web application app pools

$Credentials = Get-Credential

$ApplicationPoolAccount = New-SPManagedAccount -Credential $Credentials

$AuthProvider = New-SPAuthenticationProvider

$DBName = “WSS_Content_NoHostHeader”

$Port = “443”

$ApplicationPool = “SPWebAppsPool”

$ApplicationPoolAccount = Get-SPManagedAccount “contoso\spwebapps”

$Name = “No Host Header”

$Url = “https://SP2016BI2”

$DatabaseName = “WSS_Content”

New-SPWebApplication -Name $Name -ApplicationPool $ApplicationPool `

-ApplicationPoolAccount $ApplicationPoolAccount -SecureSocketsLayer -Port $Port `

-Url $Url -AuthenticationProvider $AuthProvider -DatabaseName $DatabaseName `

-AuthenticationMethod Kerberos -Verbose

clip_image004

Let’s create a new site collection.

New-SPSite -Url https://sp2016bi2 -Template STS#0 -Name “No Host Header” -Description “No Host Header” -OwnerAlias contoso\spadmin -Verbose

Before we test the site we have to import the SSL Certificate in IIS and assign it to our web application. Open IIS Manager – Click on Server Node – Server certificates.

I copied the certificate from domain controller. I will post later on how to request new certificate using Certificate Authority.

Click Import – Browse and select the pfx file and enter the password and click OK.

clip_image006

Double click on the certificate to confirm its path is valid.

clip_image008

Expand Sites – Click on No Host Header – Click Bindings from Actions – Edit Site – Click Edit – Select you SSL Certificate from Drop down – Click OK then Close. Then Minimize IIS.

clip_image010

Let’s browse the site – Type https://ServerName for me it is https://sp2016bi2/. You will get SSL Certificate error as our certificate is wildcard.

clip_image012

Now Let’s create the Portal Web Application. The script will be different this time.

$AuthProvider = New-SPAuthenticationProvider

$Port = “443”

$ApplicationPool = “SPWebAppsPool”

$ApplicationPoolAccount = Get-SPManagedAccount “contoso\spwebapps”

$Name = “Portal16”

$HostHeader = “$Name.contoso.com”

$DatabaseName = “WSS_Content_$Name”

$Url = “https://$HostHeader”

New-SPWebApplication -Name $Name -ApplicationPool $ApplicationPool `

-SecureSocketsLayer -Port $Port -Url $Url -AuthenticationProvider $AuthProvider `

-HostHeader $HostHeader -DatabaseName $DatabaseName -AuthenticationMethod Kerberos -Verbose

clip_image014

Now let’s create the site collection.

New-SPSite -Url $Url -Template STS#0 -Name $Name -Description $Name -OwnerAlias contoso\spadmin -Verbose

Now let’s browse the site collection, but before that I need to make a DNS entry. I logged into my Domain Controller, open DNS Manager – Expand Forward Lookup Zone – contoso.com – right click and choose New Host A or AAA

clip_image016clip_image018 clip_image020

I also added another for mysites.

Now come back to SharePoint Box and in PowerShell or command window perform

ipconfig /flushdns

Then try to ping both Portal16 and MySites16

clip_image022

Now type https://portal16.contoso.com/ in browser. Once asked for credentials, type user and password.

clip_image024

clip_image026

Now let’s create the my site host –here the My Site host template will change. You can find about templates by running the following command.

Get-SPWebTemplate | ? Title -Like “*My Site*”

$AuthProvider = New-SPAuthenticationProvider

$Port = “443”

$ApplicationPool = “SPWebAppsPool”

$ApplicationPoolAccount = Get-SPManagedAccount “contoso\spwebapps”

$Name = “MySites16”

$HostHeader = “$Name.contoso.com”

$DatabaseName = “WSS_Content_$Name”

$Url = “https://$HostHeader”

New-SPWebApplication -Name $Name -ApplicationPool $ApplicationPool `

-SecureSocketsLayer -Port $Port -Url $Url -AuthenticationProvider $AuthProvider `

-HostHeader $HostHeader -DatabaseName $DatabaseName -AuthenticationMethod Kerberos -Verbose

New-SPSite -Url $Url -Template SPSMSITEHOST#0 -Name “My Site Host” -Description “My Site Host” -OwnerAlias contoso\spadmin -Verbose

clip_image028

Updating Personal Site

You will notice a change in the output. Before we browse the site, let fix a few things.

1. Enable Self Service Site Creation

a. Application management

b. Self-Service Site Collection Management

c. Select My Site Web application

d. Click On

e. Select Personal Site Quota

f. Click OK

clip_image030

2. Create Managed Path for Personal

a. Click on Manage Web application

b. Select My Sites and Click on Managed Paths

c. Type Personal and Add. Click OK

clip_image032

3. Update My Site Configuration

a. Click Application Management – Manage Service Application – User Profile Service Application – Setup My Site

b. Change My Site Host Location to https://mysites16.contoso.com

c. Change Personal Site Location to personal

d. Click on Check names – Click OK.

clip_image034

clip_image036

Click on Newsfeed – You might have refresh a couple of times to finish this process.

clip_image038

I am facing a newsfeed issue right now but will give it few minutes to warm up.

clip_image040

The reason for this error was the feed identifier property of my user profile was referring to my old port 80 web application. I cleared the value and deleted the personal site of spadmin and Adam barr accounts that I tested before, using the script on next page.

clip_image042

Once I did that I saw the new message. We have to wait for few minutes to move to next step.

clip_image044

The issue was not resolved then as I was getting the following error in ULS.

MBUtilities.UserProfileFeedIdentifier Exception:[System.IO.FileNotFoundException: https://mysites16.contoso.com/personal/spadmin/Lists/PublishedFeed —> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)

at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)

at Microsoft.SharePoint.SPWeb.GetList(String strUrl)

at Microsoft.Office.Server.Microfeed.MBUtilities.GetPublishedFeedListPrivate(SPWeb web, String relativeUrl)

at Microsoft.Office.Server.Microfeed.MBUtilities.GetPublishedFeedListPrivate(SPWeb web, String relativeUrl)

at Microsoft.Office.Server.Microfeed.MBUtilities.UserProfileFeedIdentifier(SPWeb web, Guid partitionID)]

I logged into PowerShell ISE as my Farm Account and executed the following script.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$site = new-object Microsoft.SharePoint.SPSite(“https://mysites16.contoso.com/”);

$ServiceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($site);

$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext);

$profile = $ProfileManager.GetUserProfile(“contoso\spadmin”);

Remove-SPSite $profile.PersonalSite -Confirm:$false

$profile.CreatePersonalSite()

#Repeat the above script for any other user.

The result is below.

clip_image046

clip_image048

To Fix the login Prompt issue please add *.contoso.com in your browser intranet zone. I like leaving it like that for testing different accounts.

FAST Site Collection Creation

I am not sure if you have notice something new popping up in the list of Site collections. If you go to PowerShell ISE and type Get-SPSite –Limit All, Check the output

clip_image050

Right in the middle is sitemaster site collection. Microsoft has add a new capability in SharePoint Server 2016 which improves the site collection creation performance by reducing the feature activation overhead. Last year I had to create a PowerShell script which runs overnight to create 50,000 personal sites for one of our client. It took very long time to finish. Using Fast Site Collection Creation method the same will be done very quickly by using SPSite.Copy to copy elements inside database, which saves time. The process is 3 steps and is only available with Personal Site creation.

1. Enable the Fast Site Creation using Enable-SPWebTempateforSiteMaster

2. Create a new Site Master for a content database and template using New-SPSiteMaster

3. Create a new Site using New-SPSite with Additional parameter –CreateFromSiteMaster.

I ran the Get-SPWebTemplatesEnabledForSiteMaster cmdlet and saw that it is already enabled for all personal site templates.

clip_image052

Now to find the master I got the list of content databases and passed the mysite database to Get-SPSiteMaster

Get-SPContentDatabase | Select Name, ID

Get-SPSiteMaster -ContentDatabase WSS_Content_MySites16

clip_image054

If you want to find out what features will be activated you can find them using the script below

$Master = Get-SPSiteMaster -ContentDatabase WSS_Content_MySites16

foreach($Feature in $Master.FeaturesToActivateOnCopy)

{

$AFeature = Get-SPFeature -Identity $Feature.FeatureId

Write-Host $AFeature.ID $AFeature.DisplayName

}

clip_image056

To find more information go to Post from Bill Baer

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s