Articles about European Sharepoint Hosting Service
Posts tagged UK Sharepoint 2013 Hosting
SharePoint 2013 Hosting – HostForLIFE.eu :: Excel Services Application New Excel DataConnection Library In SharePoint 2013 Using PowerShell
Nov 16th
This course will help you learn the basics or refresh your knowledge and then provide a deeper understanding of advanced features to anyone interested in learning SharePoint 2013 from beginners to advanced users.
In this blog we will learn about how to add a new data connection library to Excel Services Application using PowerShell cmdlets.
SharePoint 2013 is a collaboration environment that organizations of all sizes can use to increase the efficiency of business processes.
Excel Service Application
Excel Services is a business intelligence tool that allows you to share data-connected workbooks across an organization.
Excel Services in SharePoint Server 2013 is a shared service that you can use to publish Excel 2013 workbooks on SharePoint Server.
Why we are using these commands?
Excel Services Application loads only workbooks that are stored in a trusted file location.
Steps
Open your SharePoint Management Shell.
Copy the below code.
Run this one.
1 |
onLibrary -Address <String> -ExcelServiceApplication <SPExcelServiceApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Description <String>] [-WhatIf [<SwitchParameter>]] |
Example
1 |
Get-SPExcelServiceApplication -Identity "ExcelServiceApplication" | New-SPExcelDataConnectionLibrary -address "http://gowtham/site/demo" -description "This is Demo" |

SharePoint 2013 Hosting UK – HostForLIFE.eu :: How to Find The Installed SharePoint 2016 Edition Via C#
Nov 9th
You can easily get the SharePoint Build Number via C# as shown below.
1 2 3 4 5 6 7 |
public string Get_SPVersion() { try { return SPFarm.Local.BuildVersion.ToString(); } catch (Exception) { throw; } } |
But, have you ever tried to detect the SharePoint Edition via C#? Well, regardless of the answer, detecting the SharePoint Edition via C# is not just a line of code as Build Number. To detect the SharePoint 2016 Edition, it will require knowing the corresponding SKU. Stock Keeping Unit (SKU) is a unique set of characters’ identification code for a particular product/service. Read more at SKU.
Get SharePoint 2016 Edition via C#
Based on the installed product SKU, you can detect the corresponding SharePoint 2016 Edition programmatically, as the following.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
public string Get_SPEdition() { try { string edition = ""; SPSecurity.RunWithElevatedPrivileges(delegate() { var editionguid = SPFarm.Local.Products; foreach(var item in editionguid) { switch (item.ToString().ToUpper()) { // SharePoint 2016 case "5DB351B8-C548-4C3C-BFD1-82308C9A519B": edition = "SharePoint Server 2016 Trail."; break; case "4F593424-7178-467A-B612-D02D85C56940": edition = "SharePoint Server 2016 Standard."; break; case "716578D2-2029-4FF2-8053-637391A7E683": edition = "SharePoint Server 2016 Enterprise."; break; default: edition = "The SharePoint Edition can't be determined."; break; } } }); return edition; } catch (Exception) { return "An error occurred! Make sure that\r\n- The SharePoint is installed"; } } |
In case, it’s
1 2 3 |
5DB351B8-C548-4C3C-BFD1-82308C9A519B, the installed SharePoint Edition is SharePoint 2016 Trial. 4F593424-7178-467A-B612-D02D85C56940, the installed SharePoint Edition is SharePoint 2016 Standard. 716578D2-2029-4FF2-8053-637391A7E683, the installed SharePoint Edition is SharePoint 2016 Enterprise. |
Output
(Test1) You have SharePoint 2016 installed. The result should look like –
(Test2) You don’t have SharePoint 2016 installed but you have other SharePoint version, the result should look like –
(Test3) You don’t have any SharePoint version installed, the result should look like –

SharePoint 2013 Hosting UK – HostForLIFE.eu :: How to Creating Custom Gulp Tasks In SPFx Solutions?
Nov 2nd
Let us see how to create and test the Gulp tasks in SharePoint Framework solutions. In my previous article, you can get the basic understanding of Gulp tasks in the SharePoint framework solutions. As we already know, Gulp tasks and commands help in automating the manual tasks required for solutions. These tasks are defined in the gulpfile.js. By default, some of the tasks or methods are loaded in the Gulp files. These tasks are required for building, bundling, or packaging the solutions. You could see each of these tasks in the previous article.
Let us take a basic example of creating a task for incrementing the version of SPFx solution. This is the manual task required before updating or deploying the SPFx solution onto the SharePoint sites. Here, we will try to automate the same using Gulp task.
The basic syntax for defining the task will be as follows.
build.task(taskname, custommethod());
The custom method will contain the steps for updating the version of the solution. The arguments can be passed to the method using the commands. So, for example, to call or execute the above task, the command used will be –
1 |
gulp taskname --argument1 |
Likewise, any number of arguments can be passed.
The below code sample shows gulpfile.js file which has the steps required for updating the version number using Gulp task. The task name is “update-spfx-solution”. The argument passed will be –updateVersion. This argument is to execute and validate the version updating steps only.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
'use strict'; const gulp = require('gulp'); const build = require('@microsoft/sp-build-web'); const fs = require('fs'); build.task('update-spfx-solution', { execute: (config) => { return new Promise((resolve, reject) => { // Code snippet for updating version if(config.args['updateVersion']){ let json = JSON.parse(fs.readFileSync('./config/package-solution.json')); var majorVersion = parseInt(json.solution.version.split('.')[0]); majorVersion++; json.solution.version = majorVersion + '.0.0.0'; fs.writeFileSync('./config/package-solution.json', JSON.stringify(json)); resolve(); } ///// Other code/functions to be continued here }); } }); build.initialize(gulp); |
In the above sample,
Argument is validated. (Command should contain the updateVersion flag)
Package-solution.json file is read using fs package.
The file is parsed as JSON and the version number is retrieved.
Version number is incremented and the same is updated by stringifying the JSON.
The following snapshot shows the package-solution.json file before executing the command.
The following snapshot shows the command executed.
The following snapshot shows the package-solution.json file after executing the command
Summary
Thus, you have learned to create custom Gulp tasks which help in automating the manual tasks in SharePoint framework solutions.

SharePoint 2013 Hosting UK – HostForLIFE.eu :: How to Get Group Users From SharePoint Site Using PnP Powershell
Oct 26th
In this blog, we are going to see how to get the list of available groups and users from SharePoint site using PnP PowerShell.
The below PowerShell command retrieves all the SharePoint Groups from the SharePoint site and its users with users count for the group.
Get-PnPGroup PnP PowerShell cmdlet gets the SharePoint Groups from the SharePoint site collection.
1 2 3 4 |
PS:> $cred = Get-Credential PS:> Connect-PnPOnline -Url https://<tenant>.sharepoint.com/sites/dev -Credential $cred PS:> $groups = Get-PnPGroup | Select-Object Title,Users PS:> $groups | format-table @{Expression = {$_.Title};Label='Group'},@{Expression = {$_.Users.Title};Label='Users'},@{Expression = {$_.Users.Count};Label='UsersCount'} |
And here is the output:
SharePoint 2013 Hosting UK – HostForLIFE.eu :: How to Add User To SharePoint Database Admin Using PowerShell Script?
Oct 12th
This course will help you learn the basics or refresh your knowledge and then provide a deeper understanding of advanced features of SharePoint 2013 from beginners to advanced users.
SharePoint 2013 is a collaboration environment that organizations of all sizes can use to increase the efficiency of business processes.
PowerShell is essentially the same, but with a lot more power. You can type your commands there and see the results just like before.
However, the benefit is that you can add your own “Shells” or set commands to enable the person using it to do more.
Steps
Use the Add-SPShellAdmin cmdlet to add a user to the SharePoint_Shell_Access role.
Syntax
1 |
Add-SPShellAdmin [-UserName] <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-database <SPDatabasePipeBind>] [-WhatIf [<SwitchParameter>]] |
Specifies the GUID of the database or the Database object that includes the SharePoint_Shell_Access role to which you want to add the user.
The Database parameter is not specified, the configuration database is used by default.
The farm configuration database is always included- if you specify another database.
Example
This will add a new user to the SharePoint_Shell_Access role in the farm configuration database.
1 |
Add-SPShellAdmin -UserName SPDEV\gowtham |
This will add a new user to the SharePoint_Shell_Access role in both, the specified content database and the configuration database, by passing a database GUID to the cmdlet.
1 |
Add-SPShellAdmin -UserName SPDEV\gowtham -database 4hty1d844-3d45-4501-8dd1-98f960359fa6 |
Conclusion
Was my blog helpful? If yes, please let me know and if not, please explain what was confusing or missing. I’ll use your feedback to double-check the facts, add info and update this blog.
SharePoint 2013 Hosting UK – HostForLIFE.eu :: Changing SharePoint Admin Account Password
Sep 14th
The scenario I’m blogging today is common for both SharePoint 2010 & SharePoint 2013 Hosting. Also you can find so many blog posts written about changing SharePoint admin account password or changing SharePoint Service account password. But what if you use the same admin user in two farms in two different geographical locations. Assume, we have two farms, one in US and another in Singapore two directory servers enabled with AD Sync. Your requirement is to change the password of the SharePoint Setup admin (SP_Admin) which is a managed user that has been used both in US farm and the farm in Singapore to setup SharePoint.
First you need to log in to one of the farms, go to central admin > Security > Config Managed Accounts.
There you select the user, edit the settings and change the password of the user. Simple as that. But what about the other farm? Same process won’t work as you have already changed the password of the same user.
Log in to the second farm, fire up SharePoint PowerShell window with admin privileges.
Type the cmdlet given below.
1 |
Set-SPManagedAccount -UseExistingPassword -Identity YourDomain\SP_Admin |
This will save your day. But let’s look into what goes behind.
SharePoint saves all Managed user passwords in config database. So when we change it in the first farm it saves the new password in the config database. But now considering the second farm, it still have the old password saved in the database. If you try to add a new password, SharePoint will compare the existing saved password with the current password (which we changed in the first farm) of the user and will not allow you to change the password from the second server.
So the easiest option available is to ask SharePoint to save and use the existing password of the user.