CSOM of the Day: Introduction

Standard

Over the coming few weeks, I’m going to release some of the CSOM, SharePoint Online and PowerShell scripts that I use on a daily basis and use to deploy and configure our customers.  Any questions please do add them to the comments section and I’ll do my best to answer them.

I’ll also through in a few other PowerShell scripts that I use for SharePoint Online and hope you find them useful.

To make them easy to publish meaning I can do more and more and try and get them out as quickly as possible.  Here is a quick explanation of what to look out for in the script.

Add-Type –Path I:UsersAlexSkyDriveDeploymentbinMicrosoft.SharePoint.Client.dll
Add-Type –Path I:UsersAlexSkyDriveDeploymentbinMicrosoft.SharePoint.Client.Runtime.dll

This will import the 2 SharePoint DLLs required to complete commands and connect to Office 365.  Download them from the internet or get them from your SharePoint server.

We then need to connect to the environment giving a URL, username and password.

$username = “spadmin@bfcnetworks.onmicrosoft.com”
$password = Read-Host -Prompt “Enter password” -AsSecureString
$siteUrl = “https://bfcnetworks.sharepoint.com/”

When you run this script, you will get a pop out window asking for the password for the user you are connecting as.

We now connect using the URL, username and password using the DLLs.

$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$ctx.Credentials = $credentials

And to finish off, we load the SIte/Web.

$web = $ctx.Web
$ctx.Load($web)
$ctx.ExecuteQuery()

You will see this section a lot as it loads what we are asking for from SharePoint

Each post will include this but this post will be used as a guide.

I personally like to use the Windows PowerShell ISE so give it a go yourselves.

CSOM-of-the-Day

SPSUK: Slides Planning for SharePoint 2013 in our 2010 Project

Standard

Its was a pleasure to be able to present at the UK SharePoint Saturday in December 2012 and have people come and listen to this subject.

I decided to talk about the differences as I know there are many companies still planning to deploy SharePoint 2010 and all of a sudden 2013 is now here but there are a few things that we can do now in 2010 that will help us and that is what this session was all about.

Thanks to those who came and listened

SharePoint 2013 Save Site As Template does not appear after deactivating Publishing Feature

Standard

Having been use to the Save Site As Template for a number of years and using it with teachers to create their own template for their classes, I have noticed a slight bug in 2013.

In SharePoint 2013, you do not get the Save Site As Template feature when the Publishing Feature is activated on a site but when you deactivate this feature the link still does not appear and if you navigate to the correct URL for the save option you get the below error.

clip_image001

clip_image003

To solve this problem you will need to install SharePoint Designer 2013 and open the site you have the issue with.

Once you have opened the site and at the landing page you will see Site Options in the top Ribbon (last).

clip_image004

Click this and you will open a small window which you will see a parameter called ‘SaveSiteAsTempalteEnabled’ and that it’s value is false. Click on Modify and change this to true.

clip_image005

When you have done this got back to Site Settings and you will see Save as Site Template now appear and available.