Microsoft Office Developer Tools Preview 2 for Visual Studio 2015


https://www.microsoft.com/en-us/download/details.aspx?id=51683

This preview ships with new templates that support SharePoint 2016 for SharePoint solutions and add-ins.

Microsoft Office Developer Tools Preview 2 for Visual Studio 2015 enables you to develop SharePoint solutions and add-ins for SharePoint 2016.
This preview also includes the latest features in Microsoft Office Developer Tools Update 2 for Visual Studio 2015–you can create new Office add-in projects using templates specific to an Office application (Word, Excel, Outlook, and PowerPoint). These new templates support new Office features such as add-in commands, Fabric UI, and new functionalities in Office.js.
This preview must be installed on top of an earlier version of the Microsoft Office Developer Tools for Visual Studio 2015. Before installing this preview, go to aka.ms/officedevtoolsforvs2015 to get the tools.

Installing SharePoint 2016 Part 8


Creating Project Server 2016 Web App

Around 10 years ago, I was on a full time job of working as Project Server consultant and developer working with project managers and team leads in writing project plan and then creating SQL reports that helped the company making informed decision on the workforce. Project server has changed allot since then but with SharePoint 2016 a lot has changed now.

Installation

Step 1 – Download Project Server 2016 installation files. Stop! Just Kidding. Project Server 2016 is now part of SharePoint 2016 setup. You just need the License key of Project Server and a single line of PowerShell will enable the project server on the server.

You can get the SharePoint Server 2016 ISO and License keys for both Project Server and SharePoint Server from http://www.microsoft.com/en-us/download/details.aspx?id=51493

Enabling Project Server 2016

Open PowerShell ISE as administrator – add the SharePoint snapin and run the following cmdlet.

Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
Enable-ProjectServerLicense -Key “Y2WC2-K7NFX-KWCVC-T4Q8P-4RG9W”

clip_image002

Creating Project Server Service Application

This is simple process using PowerShell or User Interface.

$ApplicationPool = Get-SPServiceApplicationPool “SharePoint Web Services Default”

$ProjectServiceApp = New-SPProjectServiceApplication -Name “Project Service Application” -ApplicationPool $ApplicationPool -Verbose

New-SPProjectServiceApplicationProxy -Name “Project Service Application Proxy” -ServiceApplication $ProjectServiceApp -Verbose

clip_image004

Creating Project Server Web App

First choose the web application where you want to create the site. We will do all the steps with PowerShell.

If you are not familiar with Project Server then you need to know that the database structure of Project Server is different than a SharePoint content database. It has its own tables and schema. Traditionally Project Server used to have 4 Databases which were later merged to single. Content database is always there to store the Project sites which store project documents.

So as a step one we will create a new content database and set it site limit to one so no one can create the site again.

$WebApplication = Get-SPWebApplication https://portal16.contoso.com

$ProjectDB = New-SPContentDatabase -Name “WSS_Content_ProjectSite” -WebApplication $WebApplication -MaxSiteCount 1 -WarningSiteCount 0

clip_image006

Note: You can also create new SPSite object directly in a new content database but if you are on a heavily used SharePoint Farm it is highly likely that another site collection will be create in the same DB.

You can create the project web app like https://portal.com/sites/pwa but traditionally it is created as https://portal.com/pwa. So I will first add a new managed path as explicit inclusion.

New-SPManagedPath “PWA” -Explicit -WebApplication $WebApplication -Verbose

To create the Web app run the following cmdlet.

$Site = “https://portal16.contoso.com/PWA”

$Template = “pwa#0”

$Name = “Project Web App”

New-SPSite -Url $Site -Template $Template -Name $Name -Description $Name -ContentDatabase $ProjectDB -OwnerAlias contoso\spadmin

Wait for few minutes to complete the process. We are not done yet. We have just created a project web app site collection. We now need to provision the database schema by running the following

Enable-SPFeature pwasite -Url $Site -Verbose

Start-Sleep 300

I also kept my ULSViewer started and filtered to see “Product” eq “Project Server”.

clip_image008

Wait for few minutes to see some activity in Project Server e.g. Queue etc. This will ensure that all components are project server have come online.

clip_image010

Let’s browse the site.

clip_image012

Here you go.

clip_image014

Installing SharePoint 2016 – Part 7


Fixing the SSL Troubles

After I completed the app configuration above in part 6, I opened my portal web site and saw an issue. The portal.contoso.com was giving a certificate error.

image

I went to IIS and saw that the app certificate is assigned to my portal web application. It is a normal configuration of IIS which set the SSL Certificate as default for all web site using portal 443.

image

Please note that if you try to edit the binding without the additional IP address you will see the below message and certificate will be assigned to all SSL web apps.

image

Now there are two steps to fix it.

1. Add an * in the No Host Header bindings to specify wildcard (Server 2012/R2 or Later)

2. Add an additional IP Address on the WFE and change the No Host Header web application binding on that IP address and Apps SSL Certificate (2008 R2)

Note: Some people also use SNI but it is not clear if it is fully supported.

Let’s Fix it.

First I will Open my Network Adapter configuration and add an additional IP Address.

Open Network and Sharing Center – Change Adapter Settings – Right Click on your Adapter – Properties – Internet Protocol version 4 – Properties –

image

Advanced – IP Settings – Add – Add the additional IP and Subnet mask

Before you click OK. Open command prompt and ping that IP Address to confirm that it is not used already.

image

Click Add once confirmed

image

Then OK – OK – Close

Ping the IP address again to confirm.

image

Right Click on No Host Header Web site from IIS console and choose Edit Bindings

image

Select the binding and click Edit – From IP Address drop down select the new IP Address – Make sure App Certificate is selected and click OK.

image

image

Next I will edit the bindings of MySite and Portal web apps to use original wildcard certificate.

image

image

Final step would be to update the AAA Host Name entry for our Development VM to point to new IP Address.

Login to Domain Controller – DNS Manager – Forward Lookup Zone – Console.com

image

Double Click on your VM entry and change the IP Address

image

Click Apply OK.

Go back to SharePoint VM – Open command prompt and type ipconfig /flushdns

image

Now ping your VM name to confirm the new IP address.

Close all browsers and open a fresh one and browse the portal

image

Certificate error is now gone. Click on the SharePoint hosted app

image

On my VM I will be asked for authentic ation again. On a client computer it does a single sign on.

image

image

Issue resolved.

Automatic Creation of Managed and Crawl Properties


SharePoint 2013/2016 automatically generates managed and crawl properties for site columns. This makes the life of site collection administrator lot easier. In this post I will put a real example of how to test it.

Step 1

Create Site columns and content type and add it to a list. I used the PowerShell below to do that

Add-PSSnapIn “Microsoft.SharePoint.Powershell”

#Get the site collection and web object

$siteColl = Get-SPSite -Identity “https://portal16.contoso.com/”

function Create-SiteColumnText ($siteColl, $CustomColumn)

{

$rootWeb = $siteColl.RootWeb

#Assign fieldXMLString variable with field XML for site column

$fieldXMLString = “<Field Type=’Text’ Name=’$CustomColumn’

Description=’Indicate date of last and next meeting and names of current members.’

DisplayName=’$CustomColumn’

StaticName=’$CustomColumn’

Group=’Custom Columns’

Hidden=’FALSE’

Required=’FALSE’

Sealed=’FALSE’

ShowInDisplayForm=’TRUE’

ShowInEditForm=’TRUE’

ShowInListSettings=’TRUE’

ShowInNewForm=’TRUE’></Field>”

#See field XML on console

#write-host $fieldXMLString

#Create site column from XML string

$rootWeb.Fields.AddFieldAsXml($fieldXMLString)

Write-Host “Column Added”

}

function Create-SiteColumnChoice ($siteColl, $CustomColumn)

{

$rootWeb = $siteColl.RootWeb

#Assign fieldXMLString variable with field XML for site column

$fieldXMLString = “<Field Type=’Choice’

Name=’$CustomColumn’

Description=’Choice.’

Format=’Dropdown’

DisplayName=’$CustomColumn’

StaticName=’$CustomColumn’

Group=’Custom Columns’

Hidden=’FALSE’

Required=’FALSE’

Sealed=’FALSE’

ShowInDisplayForm=’TRUE’

ShowInEditForm=’TRUE’

ShowInListSettings=’TRUE’

ShowInNewForm=’TRUE’>

<Default>Specification</Default>

<CHOICES>

<CHOICE>Specification</CHOICE>

<CHOICE>Development</CHOICE>

<CHOICE>Test</CHOICE>

<CHOICE>Documentation</CHOICE>

</CHOICES>

</Field>”

#See field XML on console

#write-host $fieldXMLString

#Create site column from XML string

$rootWeb.Fields.AddFieldAsXml($fieldXMLString)

Write-Host “Column Added”

}

Create-SiteColumnText -siteColl $siteColl -CustomColumn “MyCustomColumn1”

Create-SiteColumnText -siteColl $siteColl -CustomColumn “MyCustomColumn2”

Create-SiteColumnText -siteColl $siteColl -CustomColumn “MyCustomColumn3”

Create-SiteColumnChoice -siteColl $siteColl -CustomColumn “MyCustomColumn4”

$web = $siteColl.RootWeb

$ctypeName = “MyCustomContentType”

$ctypeParent = $web.availablecontenttypes[“Item”]

$ctype = new-object Microsoft.SharePoint.SPContentType($ctypeParent, $web.contenttypes, $ctypeName)

$web.contenttypes.add($ctype)

$field = $web.fields.getfield(“MyCustomColumn1”)

$fieldLink = new-object Microsoft.SharePoint.SPFieldLink($field)

$ctype.fieldlinks.add($fieldLink)

$field = $web.fields.getfield(“MyCustomColumn2”)

$fieldLink = new-object Microsoft.SharePoint.SPFieldLink($field)

$ctype.fieldlinks.add($fieldLink)

$field = $web.fields.getfield(“MyCustomColumn3”)

$fieldLink = new-object Microsoft.SharePoint.SPFieldLink($field)

$ctype.fieldlinks.add($fieldLink)

$field = $web.fields.getfield(“MyCustomColumn4”)

$fieldLink = new-object Microsoft.SharePoint.SPFieldLink($field)

$ctype.fieldlinks.add($fieldLink)

$ctype.Update()

$ListTitle = “CustomList1”

$Web.Lists.Add($ListTitle, $ListTitle, 100)

$Library =$Web.Lists[$ListTitle]

$Library.ContentTypesEnabled = $true

$Library.ContentTypes.Add($ctype);

$Library.ContentTypes.Delete($Library.ContentTypes[0].Id)

$Library.ContentTypes.Count

$Library.Update()

$Array = @(“Specification”, “Development”, “Test”, “Documentation”)

for ($i = 1; $i -lt 5; $i++)

{

$Item = $Library.AddItem()

$Item[“Title”] = “Item $i”

$Item[“MyCustomColumn1”] = “Item $i Column $i”

$Item[“MyCustomColumn2”] = “Item $i Column $i”

$Item[“MyCustomColumn3”] = “Item $i Column $i”

$j = $i

$Item[“MyCustomColumn4”] = $Array[$j-1]

$Item.Update()

Write-Host “Done…” -ForegroundColor Green

}

clip_image002

Next Step would be to run a full crawl.

Open Central Administration – Application management – Manage service application – Search Service Application – Content Sources – Choose Full crawl from All Sites Content Source. You can run increment crawl in case your farm is large but my farm only has few items.

clip_image004

Click on Crawl Log – URL View – Type the URL of the custom list and click Search

clip_image006

You see that your items are indexed. Now wait for crawl status to idle.

clip_image008

Now go back to portal site – Open Site Settings – Under Site Collection Administrator click Search Schema

clip_image010

Type MyCustom in filter textbox and Click green arrow.

clip_image012

You would see that these columns are greyed out with clear message when you edit them.

clip_image014

“Automatically created managed property.MyCustomColumnX2OWSTEXT is an automatically created managed property. You can’t see any of its existing settings or which crawled properties are mapped to it, but you can map more crawled properties to it. If you save the managed property without making any changes, all settings will be deleted.”

Once you make a change in the property, the link become’s active.

clip_image016

These properties can now be used in Content Search Web part, reminders and display templates

You can make Search Rest to read the values as well

https://portal16.contoso.com/_api/search/query?querytext=’Item 1 Column 1’&selectproperties=’Path,Url,Title,Author,MyCustomColumn1OWSTEXT’

image

Installing SharePoint Server 2016 – Part 6


Configuring SharePoint Farm for SharePoint Hosted Add-Ins

Not much has been changed for Apps other than the fact that they are now called Add-Ins. The configuration remain the same.

1. Need to setup an Apps Domain for SharePoint Apps (Zone)

2. Need a certificate for app domain

3. Perform App Configuration on Central Administration

4. Creating App Catalog Site collection,

5. Uploading and adding an Add-In

Creating App Domain for Add-Ins

SharePoint hosted Add-Ins require a unique app domain. You must create a new Zone in DNS for you farm. If you have multiple farms in your environment, you can create root domain and then a sub domain for every farm. It is fully supported by Microsoft.

1. Login to Domain Controller VM

2. Open DNS Manager – Right Click on Forward Lookup Zones – New Zone

3. Click Next

image

4. Choose Primary Zone – Click Next

image

5. Click Next.

image

6. Type In your App domain. I am using contoso16appscom

image

7. Choose do not allow auto updates. Click Next

image

8. Click Finish

image

9. Expand the Forward Lookup Zones – Right click on contoso16apps.com – New CNAME

image

10. Alias Name type * (Asterisk) – Click Browse – Double Click on Your Domain Controller Name – Forward Lookup Zone – Contoso.com – Select the SharePoint box and Click OK.

image

image

image

image

image

11. Click OK

12. Open PowerShell or command prompt and type the following

13. Ping app-1234.contoso16apps.com

image

14. Just to make sure try the same from SharePoint Box as well.

15. Now let’s complete the App Configuration

16. Open SharePoint Central Administration – Apps – Configure App URLs

image

17. To Fix the above error, I check if both App Management and Subscription Settings services are running.

Get-SPServiceInstance | ? TypeName -like “*Subscription*” | Select Id, TypeName

Get-SPServiceInstance | ? TypeName -like “*App Management*” | Select Id, TypeName

image

18. Then I check if both App Management and Subscription settings service application exist

Get-SPServiceApplication | ? TypeName -like “*Subscription*” | Select Id, TypeName

Get-SPServiceApplication | ? TypeName -like “*App Management*” | Select Id, TypeName

image

19. The result showed that I do not have the subscription settings service application. I used the script below to create it.

$AppPool = Get-SPServiceApplicationPool “SharePoint Web Services Default”

$Subscription = New-SPSubscriptionSettingsServiceApplication -Name “Subscription Settings” -DatabaseName “2016_Subscription” -ApplicationPool $AppPool -Verbose

New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $Subscription

20. Went back to Configure apps page and refresh

image

21. Now Type the app domain and App prefix and click OK.

22. Now Click on Manage App Catalog – Select the portal web application – Click OK.

image

23. Click OK after create a new app catalog site.

image

24. Type the site collection name, description and URL

image

25. Type in Primary site collection Admin and end users group name. Everyone to give all users access to apps. Click OK.

image

26. Once the site is created click on Link to Open in new tab.

image

27. Click on Apps for SharePoint – Click Upload – Select and Add-In file and click Upload. Enter apps title and click OK.

image

28. You can find the sample app here

image


Adding an Add-In to SharePoint Site.

First Open Management Shell as Administrator – type iisreset and press enter.

image

Open SharePoint Site – Click on Site Contents – Add an App – Select From your organization – App 4

Click Trust IT

image

image

Now click on the App – You will see the Certificate Error. We will resolve this error in the next step.

image

Clicking on Continue to this website will prompt for authentication.

image

image

App Configuration is complete. We will now request a certificate.

Creating a Certificate for App Domain

There are two options for certificate one is self-signed certificate and then using a certificate from Certificate authority. For some reason I did not liked self-signed certificate. I always configure enterprise certificate store in my lab. Creating a Certificate Authority in a Lab is very easy process. Please find the blog post below on how to set it up.

Installing an Enterprise Certificate Authority in Windows Server 2012

http://www.vkernel.ro/blog/installing-an-enterprise-certificate-authority-in-windows-server-2012

Once you have installed and configured the Certificate Authority, the next step would be to create a certificate template. We will create this template by duplicating the web server template. We will then make sure this template has permissions for domain computers to enroll, private key is exportable. We will then issue the template. Let’s do that.

Login to Domain Controller – Server Manager – Click Certificate Authority

image

Right Click on Certificate Template – Manage

image

Right Click on Web Server template – Duplicate Template

image

Certificate Template Console will open

Enter Template Display Name and validity Period from General Tab, from Request Handling “Allow private key to be exported”.

Do not choose 5 years. 2 years are good:)

image

image

Click on Security Tab -> Add Type “Domain Computers” – Choose Enroll – Authenticated Users – Enroll

image

image

Click OK. Minimize Certificate Template Console

In Certificate Authority Console – Right Click on Certificate Templates – New – Certificate Template to Issue

image

Choose SharePoint template that we created

image

Our template is now complete. Let’s request a new certificate for apps.

Search MMC from start screen and Open MMC

image

Click Add Snapin – Certificates – Add – Computer Accounts – Next – Finish – OK

Right Click on Personal – All Tasks – Request New Certificates

image

Click Next – Next – Click ON More information link next to sharePoint2016 Cert Template.

image

Select Common Name – type *.contoso16apps.com – Click Add

image

Select DNS – type *.contoso16apps.com – Click Add

image

From General type Friendly Name and Description – Click Apply OK.

image

Select the certificate template and click Enroll

image

image

Right Click – All Tasks – Export – Next

 image

image

Yes, export the private key – Next

image  

Click Next

image

Check the password checkbox and click Next.

image

Click Browse and provide the File name and Click Save.

image

Click Next and Finish.

image

Copy the Certificate to SharePoint VM.

Assign Apps Certificate to No Host Header Web Application

Open IIS Manager

image

Click on Server Node – Double Click on Server Certificates – Import – Select the new exported certificate – Select the certificate – enter password and click OK.

image

Right click on No Host Header Web App – Edit Bindings

image

Click Edit – Select the new Apps SSL – Click OK – Close

image

image

Go back to page where the app was loaded and click Refresh

image

Certificate Error is now gone.

Installing SharePoint 2016 – Part 5


Connecting SharePoint 2016 with Office Online Server 2016

Office Online Server 2016 is the new name of Office Web Apps Server 2013. Most of the features remain the same but the most important addition is the Excel Web App has replaced Excel services. OOS is required to view and modify Excel sheets in browsers. Just like OWA 2013, OOS must be installed on its own box. All features like PowerPivot, Power View and Data refresh will work exactly the same. Additional configuration will be required to connect OOS with Analysis Services or Business intelligence services using Server to Server Trust. You must also add the OOS Server as administrator in to Analysis Services Security in SQL Management Studio.

Microsoft has not RTM’d Office Online Server till now. You can download the preview from https://www.microsoft.com/en-us/download/details.aspx?id=49028

Some people have reporting issue with SSL Certificate with preview if you use SSL wild card cert. I suggest you only use SAN certificate for Office Online Server. To find out what kind of certificate you must create you can check the link below

http://www.wictorwilen.se/office-web-apps-server-2013—machines-are-always-reported-as-unhealthy

I would not spend any time in installation as it is exactly the same as Office Web Apps 2013. You can find all the steps are any applicable configuration from the link below.0

https://technet.microsoft.com/en-us/library/jj219455.aspx

Overall the steps to install OWA are

1. Installing the required Windows Features e.g. .NET, Web Server etc.

2. Installation of OOS Bits

3. Creation of Office Web Apps Certificate (SAN). Do not use Wildcard cert.

4. Creating the Office Web Apps Farm either using http or https using New-OfficeWebAppsFarm cmdlet.

5. Adding the Wopibindings to SharePoint and Setting up WopiZone.

There are few cmdlets that you must know. First the combination of Get-OfficeWebAppsFarm and Set-OfficeWebAppsFarm. These cmdlets are handy to double check the configuration of OOS Farm.

Get-OfficeWebAppsFarm

image

Set-OfficeWebAppsFarm -CacheSizeInGB 30

You can change any properties you want using this cmdlet.

image

The first thing you must do is to ping your web application from Office Web app serve to make your connectivity is good. On the other side, make sure you can ping your OOS box from SharePoint.

Now Open SharePoint Management Shell as Administrator and type the following cmdlets

New-SPWOPIBinding -ServerName sp2016wac.contoso.com -Verbose

Set-SPWOPIZone –Zone External-https

Get-SPWOPIZone to confirm the Wopi zone.

image

Close all browsers and open a fresh window and then open the SharePoint Site.

If all looks good, you will see the New button right on top of the library to create documents. Create a test Word or Excel files to confirm.

image

You can create Word document and then rename it right from top of the document

image

image

Let’s creat an Excel Sheet.

 image

Let’s create a PowerPoint file as well.

image

Finally OneNote File

image 

Let’s check the new search preview. Make sure you run an incremental or full crawl before testing this.

image

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&#8221;

$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&#8221;

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&#8221;

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/&#8221;);

$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