Sunday, December 25, 2016

Site columns in SharePoint Online
Site columns provides great re-usability in SharePoint without having to recreate fields every time you need them in lists and libraries. They save a lot of time especially when you have to standardize columns, create columns with data (such as choice fields) or assign default values to them. Once created at the top site, a site column can be utilized in any list or library or even content types throughout your site collection (or across site collections with content type hub).

How to Create Site Column in SharePoint Online?
To create site column in SharePoint online, follow these steps:

Login to SharePoint online site. Click on Site Settings Gear and select Site Settings.

In create column page, Enter the name for your site column. Select the column type, Specify settings specific to the column. Click on "OK" button at the bottom to complete creating site column in SharePoint Online.

Now the site column will be added to the site.

Create Site Columns using PowerShell in SharePoint Online:
Here is my collection of PowerShell scripts to create site columns in SharePoint online using client side object mode (CSOM).

Important: Field Schema XML is case sensitive!

Create Single Line of Text Site Column in SharePoint Online using PowerShell

Wednesday, December 21, 2016

Problem:
When trying to delete a content type from List or site, received below error in SharePoint online site"Another site or list is still
using this content type. If you would still like to delete it, please remove the
content type from all sites and lists and then try again."

Solution:
Find the references where a particular content type is being used and remove the content type association from the list. (You may have to delete the items of the particular content type or change the content type of the items, in order to remove the content type association from list). Also remove the items from both 1st stage (End-user) Recycle bin and 2nd stage (Administrator) recycle bins!

PowerShell to Find a Content Type Usage in SharePoint Online:
This PowerShell script scans get exports a content type references with in a given site collection.

Tuesday, December 20, 2016

The Resources list in SharePoint Central Administration site lets you to keep frequently accessed links to the home page. Say for e.g. To access User profile service application, you'll have to navigate through:

in some other cases, you'll find a difficulty in navigating To-And-Fro in SharePoint Central Administration. So, Resources list comes handy to manage this hassle. Just add your frequently accessed links to it! When you log into SharePoint Central Administration site, you'll see the Resources link list in right pane.

Consider Resources list as your Favorites or Bookmarks List!

To Add a link/remove links in resources list:

Click on "Resources" link from SharePoint Central Admin home page (or your can Click the gear icon and click Site Contents >> Find the Resources list)

From here you can add or delete the link like any list item.

This saves time and effort, especially if you have trouble finding service applications in Central Admin.

Saturday, December 17, 2016

What are content types in SharePoint Online?
Content types are set of columns grouped together to serve a specific purpose. Think about a Invoice template! Instead of you and your users end up creating different templates each time from the scratch, you can define an Invoice template once and your users can start consuming it at any number of lists or document libraries! By this way, you force standardization in your collaboration environment. Or think of "Project Tracking" list with columns required to track projects for your organization. Instead creating and adding each column for Project tracking list every time, you'll be able to simply utilize project tracking content type template in any number of lists in few clicks.

SharePoint Online lists or document libraries can contain multiple content types. E.g. You can add multiple content types such as "Invoice", "Proposal", "Purchase Order", etc to a library to organize everything related to a project as a single entity. Once you associate a content type with SharePoint online list or library, SharePoint lets you to create new items of that content type from New Item command in that list or library. In the case of a document content type, you can also define a document
template that will be the base for all the documents created from this
particular content type.

As a best practice, content types should be ideally defined at the top site, independent of any list or library, So that it can be reused at any SharePoint site underneath or even across SharePoint site collections with content type hub.

How to Create Content Type in SharePoint Online?
To add a content typein SharePoint online, follow these steps:

This script creates content type in sharepoint online from the specified parent content type. Here in this example, I've created "Project" content type from "Item" content type which has "Title" as its default field. You may want to add additional fields tot the content type and you can add columns to content type in SharePoint online with PowerShell.

Thursday, December 15, 2016

Requirement: Export Term store data from SharePoint Online site to a CSV file

Solution: There is no out of box way to export complete term store data in SharePoint online. However, we can utilize PowerShell to export term store data including all term groups, term sets and terms to a CSV file. Here is the script.

Creating SharePoint 2016 farm using PowerShell is almost as same as in its previous version. In SharePoint 2016 there is an additional parameter -LocalServerRole added as SharePoint 2016 introduced MinRoles.

Pre-Requisites:

SQL Server is already installed and ready to use.

You have created a Farm account for SharePoint 2016.

You have logged in to the server (Setup account) which has Administrator access on all SharePoint servers and DB_Creator, Security_Admin Server roles in SQL Server.

On completing the installation, Uncheck "Run the SharePoint Products Configuration Wizard now" and close the wizard.

Step 2: PowerShell Script to Create SharePoint 2016 Farm:
Save the below script as "Create-Farm.ps1" or something like that, change the configuration settings parameters as per your environment. Open SharePoint 2016 Management Shell as Administrator, and run the script. You'll see"The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered."
error for the first time, which is quite normal, since we have not created the Farm yet! proceed running the script.

Once the script completed successfully, You'll see farm created successfully message. Here I've used "SingleServer" as MinRole. You can adjust it based on your requirement.

Alternatively, You can create SharePoint Farm (Run script til line#15) and then Run Products configuration wizard to complete the rest of the steps in farm creation.

Add Additional Servers to the SharePoint 2016 Farm:
Once you are done with the creation of the SharePoint 2016 farm from first server, You can connect rest of the servers to the Farm either using SharePoint products configuration wizard or with PowerShell.

Open SharePoint products configuration wizard and choose "Connect to an existing server farm" and run through the wizard! Select the server MinRole as per your topology.

Join Additional Server to the SharePoint 2016 farm using PowerShell:
If you prefer PowerShell way to add an additional server to the farm, use this PowerShell script.

This PowerShell script generates a CSV output provided in the $ReportOutput parameter.

Please note, this script gets versioning configurations for a given site collection. You can retrieve all site collections, loop through and call the function to get version history analysis for all site collections in SharePoint online.

How to Exclude System Lists and Libraries?
Well, the above script scans all lists and libraries including system lists. Here is the change to exclude all system lists (You can add any missing!")

This script extract each term in the given term set into a CSV file. But wait! each term can go up to 7 levels deep! While the above script exports terms at one-single level, Here is my another PowerShell script to export terms and child terms of all levels of a given term set.