Tag Archives: Nottingham

Using SharePoint Groups

What is a SharePoint group?

A SharePoint group is a group of users which can be used to permission a site. Groups can be re-used around the site collection and can be used to permission, sites, lists, libraries, folders and items. Using SharePoint groups allows the administrator to control access without having to edit individual permissions, only the SharePoint group membership requires editing rather than each permission level.

Creating a SharePoint Group

Select “Site settings” from the SharePoint menu.

SharePoint Group Permissions

Select “People and Groups” from the “Users and Permissions” menu.

SharePoint Group Permissions

Select “Groups” on the left side menu, this will show a list of all the groups on the site collection.

SharePoint Group Permissions

Create a new group by selecting “New Group” from the “New” drop down menu.

SharePoint Group Permissions

Enter a name and description for the new group.

SharePoint Group Permissions

The Group owner has overall control of the group settings and members. This is usually either an administrator or someone you have delegated the running of the group to.

SharePoint Group Permissions

You can decide to keep the membership of the group private to the users in the group or let everyone see the group membership. There is also an option to allow group members to edit the membership of a group. This is great for collaborative sites where members may wish to share with others without having to go to the group owner. It helps remove some of the burden from the group owner and can open up sharing and collaboration without admin intervention.

SharePoint Group Permissions

Membership requests allow users who are not members of the group, the ability to request membership. This can be set to auto-accept which is useful for open groups or the requests can be sent to an email address for approval by the group owner (or members if this option was enabled earlier).

SharePoint Group Permissions

Permission levels can be set when creating the group. Please note that setting permissions here will only apply to the site which you are currently on. It is advised that you create the group without any permissions and then go back into the sites to add relevant permissions to avoid any confusion.

Click “Create” to finish setting up the group.

Adding members to the group

Once the group has been created, you may notice that the only member is the group owner. Additional users can be added by going to the “Add Users” option under the “New” menu.

SharePoint Group Permissions

Enter the name(s) of the members(s) you wish you add to the group. Under advanced options, you will see that the default setting is to send an email to any users added to the group. This is optional and can be deselected. In addition to this, you can customise the personal message in the email invitation for these users.

Note: Active Directory security groups can also be added here if using DirSync (in Office 365)

SharePoint Group Permissions

Click Share to add the users to the group.

Permissioning a site with a SharePoint Group

Once the group has been created, it can be used to permission subsites, lists, libraries, folders and even items. To give the group’s members permissions on a SharePoint site, first navigate to the SharePoint site itself.

Select “Site Settings” from the menu.

SharePoint Group Permissions

Select “Site permissions” from the “Users and Permissions” menu.

SharePoint Group Permissions

Select “Grant Permissions” from the “Permissions” tab.

SharePoint Group Permissions

As you start to type in the name of the group, SharePoint will pick up the group name.

SharePoint Group Permissions

Click “SHOW OPTIONS” to view the permission levels.

Select a permission level from the drop down and decide whether you would like to send an email to the group.

SharePoint Group Permissions

Avoid adding the group to another SharePoint group (this is usually the default option and can over complicate your permissions). Use one of the permission levels available:

  • Read – Can view the site but cannot edit any items or pages
  • Contribute – Can add, edit and delete list items. User cannot create new apps or sites.
  • Design – Users have contribute but in addition, they can also create and delete apps and subsites. Apply themes and designs.
  • Full Control – Users can do anything on the site including change permissions (usually admins only)

There are other permission levels, you can also specify your own. For a full reference of permission levels please see the Microsoft site:

Microsoft Office 365 Support – Permissions

Selecting an Office 365 Business plan for the first time

Microsoft provide a nice comparison list of all the available 365 plans for business.

Click here to view the comparison table

However when planning to move to Office 365, you may not have considered the implications of initially choosing a particular plan. You may also have a number of different licences for different users in the organisation (you don’t have to stick to one plan). For example some users may need to download office on their machine (accountants using the full desktop version of Excel) and some may just need a mailbox. I briefly go over the different plans in the video below.



Remember that business licences are for users who don’t need centralised deployment and control. Small businesses may opt for the business licences while larger ones may need some compliance and centralised administration.

Just a quick note on upgrading licences for older tenancies using the Office 365 small business plan. I recently worked with a client using the old Small Business licences, they wanted to upgrade to enterprise but due to it being on the old 365 platform, it wasn’t possible to upgrade from within the admin centre. The only option to upgrade was to create a new tenancy, manually migrate PST files (exchange) and re-sync document libraries (SharePoint) up to the new tenancy using OneDrive for business sync tool. Very annoying and a lot of work! However all users on the new platform with Business licences can upgrade their licences in-place by going to the subscriptions page. I have also been informed by Microsoft that these older plans cannot be renewed after October 2015 and Microsoft will offer some migration options before the licences run out.

SharePoint Consultancy and Services

Cloud Design Box

A few months ago, I started a new SharePoint consultancy business. I will continue to add blog posts here but you can contact me directly for any of the following Microsoft SharePoint and Office 365 services by clicking here:

  • Responsive design and branding
  • Site architecture planning and implementation
  • Workflow and consultancy services
  • SharePoint upgrades
  • Office 365 configuration
  • SharePoint Support
  • Scripting and client object model solutions

We provide these services for education and for business. Please visit the website for more information www.clouddesignbox.co.uk

Looping through all subsites in SharePoint Online

SharePoint Online requires use of the Client Object model when modifying the site via PowerShell due to there being no backend server exposed in Office 365. Users with previous experience of using JavaScript Client Object model will find this a familiar method.

In the example below, the Powershell iterates through all subsites (and subsites of subsites) in a site collection or root site. This could be used for disabling a web scoped feature or automating site modification.

First of all, the variables are initiated including the path to the relevant DLLs.

#connection variables and reference DLL
$username = "user@onmicrosoft.com"
$password = "Password123"
$SiteCollectionUrl = "https://tonyishere.sharepoint.com"
Add-Type -Path "c:\Microsoft.SharePoint.Client.dll"

A new object for the client context requires creating, this can be done in a reusable function as shown below.

# Generate ClientContext function so we can reuse
function GetClientContext($SiteCollectionUrl, $username, $password) {
     $securePassword = ConvertTo-SecureString $password -AsPlainText -Force
     $context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteCollectionUrl) 
     $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePassword) 
     $context.Credentials = $credentials
     return $context
}

The following function has a nested call to call itself, this enables it to iterate through subsites of subsites. Without the nested function call, it would only cover a single subsite depth. The function writes the url of the site to the screen but this could be replaced with more complex functionality such as enabling a feature or creating a list item.

# function to loop through subsites
function catchsubsites ($subsiteurl){
	$clientContext = GetClientContext $subsiteurl $username $password
	$rootWeb = $clientContext.Web
	$childWebs = $rootWeb.Webs
	$clientContext.Load($rootWeb)
	$clientContext.Load($childWebs)
	$clientContext.ExecuteQuery()
	#do something on top level site
	write-host $rootWeb.url -ForegroundColor Yellow
	foreach ($childWeb in $childWebs)
	{
		#do something for each subsite
		write-host $childWeb.url -ForegroundColor Yellow
		#see if there are any subsites beneath this and loop all of them too
		catchsubsites $childWeb.url
	}
}

Finally the function is called to kick off the whole process of looping through the site.

#Finally run the function to get it all started!
catchsubsites $SiteCollectionUrl

This example could be refined so that it doesn’t authenticate at every request but it does show how simple it can be to create the complex PowerShell scripts that we are all used to using on SharePoint on-premises in the cloud version of Microsoft’s Office 365 SharePoint Online.

Update: Code updated 01/10/2016, fixed variable in loop and added section to run code for parent site

List subsites using the JavaScript client object model in SharePoint 2013

SharePoint Office 365 Site Creation JavaScript

To do this, use the script editor web part or the page viewer web part (and put the HTML file in a document library).

To start off, setup the HTML to include jQuery and sp.js (see below).

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {
 //alert('loaded');
});

JQuery functions are used to populate HTML containers on the page.

<div id="tonycontent">
	<!-- Dashboard -->
	<div id="tonydashboard" class="tonycontenttable">
	</div>
</div>

The first function loads the current site. The get_current function returns the current context of the user from which the subsites can be retrieved (see below).

function getSubWebs(){
	clientContext = new SP.ClientContext.get_current();
	web = clientContext.get_web();
    	webCollection = web.getSubwebsForCurrentUser(null);
    	clientContext.load(webCollection);
    	clientContext.executeQueryAsync(onGetSubwebsSuccess, onGetSubwebsFail);
}

If the query is successful it will load the onGetSubwebsSuccess function, otherwise it will run onGetSubwebsFail function.

In the success function, the webCollection variable is looped through to retrieve the URL and the title of each subsite. JQuery functions are then used to append the HTML containers.

function onGetSubwebsSuccess(sender, args){
	jQuery("#tonydashboard").empty();
	var html4 ="<div class='tonycontenttablerow'><div class='tonycontenttabletitle'>Site Name</div><div class='tonycontenttabletitle'>Site URL</div></div>";
	jQuery("#tonydashboard").append(html4);
    var webEnumerator = webCollection.getEnumerator();	
    while (webEnumerator.moveNext()){
        var web = webEnumerator.get_current();
		var webtitle = web.get_title();
		var weburl = web.get_serverRelativeUrl();
        var html3="<div class='tonycontenttablerow'><div class='tonycontenttablecolumn'>" + webtitle + "</div><div class='tonycontenttablecolumn'>" + weburl + "</div></div>";
		jQuery("#tonydashboard").append(html3);
    }
}

Download the full code here

The client object model can also be used to create subsites from templates, permission sites, create lists and much more! This method works on both 365 SharePoint Online and SharePoint 2010 and SharePoint 2013 on-premises.

SharePoint 2013 JavaScript Client Object Model