European Sharepoint 2013 Hosting Blog

Articles about European Sharepoint Hosting Service

Follow me on TwitterRSS Feeds

  • Home
  • About

SharePoint 2013 Hosting :: How To Remove Empty Folders In Sharepoint Library Using PnP Powershell

Jun 21st

Posted by Peter in European SharePoint 2013 Hosting

A SharePoint library is a location on a site where you can upload, create, update, and collaborate on files with team members. To remove an empty folder from the library is difficult since we need to go to each and every library and identify whether it is empty or not. Then, we have to remove it from the library. To automate this process, I used Powershell scripting because it is easy to parse through each and every library using PNP library. So it is easy to identify and remove the empty folders in SharePoint library

Prerequisite

Before you begin utilizing PowerShell to oversee SharePoint Online, ensure that the SharePoint Online Management Shell is installed. You can install the SharePoint Online Management Shell by downloading and running the SharePoint Online Management Shell. You only need to do this once for each computer from which you are running SharePoint Online PowerShell commands.

Connect to Site

Connect to SharePoint site using Connect-PnPOnline cmdlet. The required parameters are,

-Url

The SharePoint site URL (Eg: https://hubflysoft.sharepoint.com/sites/Hubfly)

The following code snippet helps to connect SharePoint sites.

1
2
3
$siteurl="https://<tenant-name>.sharepoint.com"    
  
Connect-PnPOnline -Url $siteurl

Get Web Instance using Get-PnPWeb

$web = Get-PnPWeb     

The Get-PnPWeb cmdlet actually has its own Recurse option, and you could use that if you want to rather than doing your own recursion.

Get User Context using Get-PnPContext

$context = Get-PnPContext

The Get-PnPContext returns a Client Side Object Model context. This command is very handy and it returns the current context. You might need context because it might be the case you need to save the current context. By switching between two sites you need this.

Get folders from the library using Get-PnPFolder

1
$folder = Get-PnPFolder -RelativeUrl "Shared Documents"

The Get-PnPFolder returns the folder called ‘Shared Documents’ which is located in the root of the current web.

Get all subfolders and remove empty folders

Using the context we need to load all files, folders, and Parent folder like below code snippet

  1. $files = $folder.Files
  2. $context.Load($folder.Files)
  3. $context.Load($folder.Folders)
  4. $context.Load($folder.ParentFolder)
  5. $context.ExecuteQuery()

We can find the folder is empty by the following conditions,

  • Check if the files count is equal to zero
  • Check  if the folders count is equal to zero

And remove the empty folders using below PS script

1
2
3
4
5
6
7
8
9
10
11
12
Remove - PnPFolder  
if ($folder.Files.Count - eq 0 - and $folder.Folders.Count - eq 0 - and(($folder.Name - notmatch 'Document') - and($folder.Name - notmatch $libraryName)))  
{  
    $path = $folder.ParentFolder.ServerRelativeUrl.Substring($web.ServerRelativeUrl.Length)  
    Write - Host "Removing folder "  
    $folder.ServerRelativeUrl.Substring($web.ServerRelativeUrl.Length)  
    Remove - PnPFolder - Folder $path - Name $folder.Name - Recycle - Force  
    $folders_list += $folder.Name + ", " + $folder.ServerRelativeUrl  
}  
Write - Host "Searching for empty folders. Please wait..."  
$folders_list = GetAllSubFolders $folder $context  
Write - Host $libraryName 'Completed'

I hope you learned how to remove empty folders and files in the SharePoint library programmatically using PnP PowerShell scripting. The operations mentioned above are tested on SharePoint Online environment. Feel free to leave a comment  below, if you need any assistance.

Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting, trick SharePoint 2013 Hosting

SharePoint 2013 Hosting :: How to Configure existing URL located in the Top Navigation Bar?

Jun 7th

Posted by Peter in European SharePoint 2013 Hosting

In this tutorial, I will explain you how to to Configure existing URL located in the Top Navigation Bar as the referenced site URL has changed in SharePoint 2013.

SharePoint-2013-Hosting

The top link bar helps users of your site navigate to alternative sites within the site collection by displaying a row of tabs at the top of pages in the site. the top link bar is additionally referred to as global navigation, as a result of it can be the same across all of the web sites in a site collection. However, subsites can be configured to not show in the top link bar of the parent site. the options offered to you for configuring your top link bar will vary depending on whether or not the publishing features are enabled for your site collection.

1

I want to change this hyperlink to all sites inside the Web App: more than 1800 Site Collection. And I use the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$Webs = Get-SPSite -WebApplication "http://SharePoint.Contoso.com"  -limit ALL | Get-SPWeb -limit all
 
Foreach($Web in $Webs)
{
$TN = $Web.Navigation.TopNavigationBar | Where-Object {$_.Title -eq "Landing Page & Wiki"}
if ($TN.url -like "http://hostforlife.eu*")
{
   write-host "Updating $($Web.url)"
  “Updating $($Web.url), $($TN.Url)” | out-file D:\temp\LandingPageUpdate.csv   -append
    $TN.Url = "http://NewSharePoint.Contoso.com/Pages/LandingPageWikiDefault.aspx"
    $TN.update()
}
}
#----------------------------------------------------------------------

Also, in parallel, I had to modify the template used to create the new sites into this Web App. Doing this will avoid having to run this script periodically to correct the changes.

SharePoint 2013 Hosting Recommendation

HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options

recommended windows hosting

Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting, trick SharePoint 2013 Hosting

SharePoint 2013 Hosting :: How to Configure existing URL located in the Top Navigation Bar?

May 31st

Posted by Peter in European SharePoint 2013 Hosting

In this tutorial, I will explain you how to to Configure existing URL located in the Top Navigation Bar as the referenced site URL has changed in SharePoint 2013.

SharePoint-2013-Hosting

The top link bar helps users of your site navigate to alternative sites within the site collection by displaying a row of tabs at the top of pages in the site. the top link bar is additionally referred to as global navigation, as a result of it can be the same across all of the web sites in a site collection. However, subsites can be configured to not show in the top link bar of the parent site. the options offered to you for configuring your top link bar will vary depending on whether or not the publishing features are enabled for your site collection.

1

I want to change this hyperlink to all sites inside the Web App: more than 1800 Site Collection. And I use the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$Webs = Get-SPSite -WebApplication "http://SharePoint.Contoso.com"  -limit ALL | Get-SPWeb -limit all
 
Foreach($Web in $Webs)
{
$TN = $Web.Navigation.TopNavigationBar | Where-Object {$_.Title -eq "Landing Page & Wiki"}
if ($TN.url -like "http://hostforlife.eu*")
{
   write-host "Updating $($Web.url)"
  “Updating $($Web.url), $($TN.Url)” | out-file D:\temp\LandingPageUpdate.csv   -append
    $TN.Url = "http://NewSharePoint.Contoso.com/Pages/LandingPageWikiDefault.aspx"
    $TN.update()
}
}
#----------------------------------------------------------------------

Also, in parallel, I had to modify the template used to create the new sites into this Web App. Doing this will avoid having to run this script periodically to correct the changes.

SharePoint 2013 Hosting Recommendation

HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options

recommended windows hosting

Tweet
cheap europe sharepoint 2013 hosting, cheap european sharepoint server 2010 hosting, europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting, trick SharePoint 2013 Hosting

SharePoint 2013 Hosting – HostForLIFE.eu :: Custom Action Menu In SharePoint ListItem

May 24th

Posted by Peter in European SharePoint 2013 Hosting

ECB Menu For SharePoint or Custom action menu is available for user access at different locations in SharePoint. It can be an icon/text, which can be used to implement functionality such as navigating to a landing page, starting a Workflow on an item or any custom action inside SharePoint.
SharePoint-2013-Hosting
By default SharePoint provides the default custom action like edit, delete and view item options.
Here we will be adding new ECB Menu as “Custom Edit Page” as shown in the below image.

On click of the Cusom Edit Link, it will be redirected to my custom edit page which I have created under list form.

Also, I am passing the ID of current list item as well as Source page URL from where it will be redirected back after performing action on redirected edit page.
Implementaion
It can be implemented with any list/library, however I have implemented it on list.
You can use any ScriptEditor/CEWP on your page and put all below scripts as is by just changing the list name and URL.
Full Script
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
29
30
31
32
33
34
35
36
37
38
39
40
41
<script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>  
<script language="javascript" type="text/javascript">  
    $(document).ready(function() {  
        SP.SOD.executeFunc('sp.js', 'SP.ClientContext', AddCustomUserActionToECB);  
    });  
  
    function AddCustomUserActionToECB() {  
        var clientContext = new SP.ClientContext();  
        var oWeb = clientContext.get_web();  
        var oList = oWeb.get_lists().getByTitle('ComplainTracking');  
        var userCustomActionColl = oList.get_userCustomActions();  
        clientContext.load(oList, 'UserCustomActions', 'Title');  
        clientContext.executeQueryAsync(function() {  
            var customActionEnumerator = userCustomActionColl.getEnumerator();  
            var foundAction = 0;  
            while (customActionEnumerator.moveNext()) {  
                var oUserCustomAction = customActionEnumerator.get_current();  
                if (oUserCustomAction.get_title() == 'Custom Edit Page') {  
                    //oUserCustomAction.deleteObject();  
                    //clientContext.load(oUserCustomAction);  
                    //clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededdelete), Function.createDelegate(this, this.onQueryFailed));  
                    foundAction = 1;  
                    break;  
                }  
            }  
            if (foundAction == 0) {  
                var oUserCustomAction = userCustomActionColl.add();  
                oUserCustomAction.set_location('EditControlBlock');  
                oUserCustomAction.set_sequence(100);  
                oUserCustomAction.set_title("Custom Edit Page");  
                //oUserCustomAction.set_url("/sites/QA/SL_MI/SitePages/CustomSearch.aspx?ListId={ListId}&ItemId={ItemId}&ItemUrl={ItemUrl}");  
                oUserCustomAction.set_url("/sites/QA/SL_MI/Lists/ComplainTracking/Edit1.aspx?ID={ItemId}&Source=/sites/QA/SL_MI/SitePages/ListViewGrid.aspx");  
                oUserCustomAction.update();  
                clientContext.load(userCustomActionColl);  
                clientContext.executeQueryAsync();  
            }  
        }, function(sender, args) {  
            console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());  
        });  
    }  
</script>

 

Tweet
europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, Hosting cheap europe sharepoint 2013 hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting, trick SharePoint 2013 Hosting

SharePoint 2013 Hosting – HostForLIFE.eu :: How To Create A Generic List Using SharePoint JSOM?

May 17th

Posted by Peter in European SharePoint 2013 Hosting

Just copy the code below and paste it in a “content editor” webpart on a web part page. SharePoint-2013-Hosting
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<script src="//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js" type="text/javascript"></script>  
<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>  
<script type="text/javascript" src="/_layouts/15/sp.js"></script> <input id="listName" type="text" name="Listname"></input> <input id="btnCreate" type="button" value="Click me" onclick="createList()">  
<script type="text/javascript">  
    function createList() {  
        var clientContext;  
        var listCreationInfo;  
        var web;  
        var list;  
        var lstname = document.getElementById("listName").value;  
        clientContext = SP.ClientContext.get_current();  
        web = clientContext.get_web();  
        listCreationInfo = new SP.ListCreationInformation();  
        listCreationInfo.set_title(lstname);  
        listCreationInfo.set_templateType(SP.ListTemplateType.genericList);  
        list = web.get_lists().add(listCreationInfo);  
        clientContext.load(list);  
        clientContext.executeQueryAsync(function() {  
            alert("List created successfully!")  
        }, function() {  
            alert("Failed to create list!")  
        });  
    }  
</script>

 

It’s the working code. It will work 100% for you. I am using my SharePoint online account in this example. Just name the generic list in the text box you want to create then click on the Click me button as shown below.
A notification message will pop up as shown below.
 
You will find the newly created lists on the left navigation as shown below. If the list already exists it will give you a message saying that the list already exists.
It is a very basic example. I was looking for the working code but I was unable to find it anywhere, then after struggling with so many errors finally I was able to do that. I decided to post it  so new programmers can simply copy paste the code directly and understand it.
Tweet
europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, Hosting cheap europe sharepoint 2013 hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting, trick SharePoint 2013 Hosting

SharePoint 2013 Hosting – HostForLIFE.eu :: Create Post List In SharePoint Team site

May 3rd

Posted by Peter in European SharePoint 2013 Hosting

In this article I would like to share the steps to create post list in SharePoint team site. By default, post list is available in blog template site.SharePoint-2013-Hosting

I got a requirement that a customer needs the post list in the SharePoint team site, but post list template is not available in SharePoint team site. There is a solution to create post list in SharePoint team site by activating the feature.

What is blog post list and why do we need post list?

  • The blog post list is used to share the ideas and information to your organization
  • Mainly blog post lists use Intranet portals
  • We can comment the post and like/unlike the posts
  • It can be created quickly and they often have an informal tone

Here is the code to activate the “Blog content” feature.

Add the below code in content editor webpart or script editor webpart.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>  
<script type="text/javascript">  
    $(document).ready(function() {  
        SP.SOD.executeFunc('sp.js', 'SP.ClientContext', LoadFeature);  
    });  
  
    function ActivateWebFeature(web) {  
        var guid = new SP.Guid('{0d1c50f7-0309-431c-adfb-b777d5473a65}');  
        var featureFef = web.get_features().add(guid, true, SP.FeatureDefinitionScope.farm);  
    }  
  
    function LoadFeature() {  
        context = new SP.ClientContext("http://test.sharepoint.com");  
        var web = context.get_web();  
        //Activate Features  
        ActivateWebFeature(web);  
        context.load(web);  
        context.executeQueryAsync(function() {  
            console.log("Featured activated for Web: " + web.get_serverRelativeUrl());  
        }, function(sender, args) {  
            console.log('Error: ' + args.get_message() + '\n' + args.get_stackTrace());  
        });  
    }  
</script>

The list will be created on your team site, those lists are relevant to the blog feature. In this article we have learned how to create a post list in SharePoint team site. Now you can enjoy the blog feature in team sites as well.

Tweet
europe sharepoint 2013 hosting, fast SharePoint 2013 Hosting, France Sharepoint 2013 Hosting, free SharePoint 2013 Hosting, Hosting cheap europe sharepoint 2013 hosting, india SharePoint 2013 Hosting, recommended SharePoint 2013 Hosting, SharePoint 2013 Hosting belgium, SharePoint 2013 Hosting germany, SharePoint 2013 Hosting Italy, SharePoint 2013 Hosting netherlands, SharePoint 2013 Hosting poland, SharePoint 2013 Hosting review switzerland, SharePoint 2013 Hosting UK, SharePoint Hosting 2013 Paris Server, Spain Sharepoint 2013 Hosting, tips SharePoint 2013 Hosting, Top Sharepoint 2013 hosting, trick SharePoint 2013 Hosting
« First...10«1819202122»304050...Last »
  • BLOGROLL

    • ASP.NET BLOG
    • ASP.NET MVC BLOG
    • Christian BLOG
    • Cloud Hosting ASP.NET
    • Europe Cloud Linux Hosting
    • HostForLIFE Blogspot
    • HostForLife.eu
    • Hosting Cheap ASP.NET
    • IIS BLOG
    • Silverlight BLOG
    • Windows ASP Hosting Review
    • Windows BLOG
  • Featured On

    • Best Windows Hosting ASP.NET
    • Cheap Hosting ASP.NET
    • Cheap Hosting Windows
    • Cloud Hosting ASP.NET
    • Discount Windows Hosting
    • Full Trust Hosting ASP.NET
    • Hosting For Ecommerce
    • Hosting Review ASP.NET
    • I Host Azure
    • Reliable Hosting ASP.NET
    • Review Hosting ASP.NET
    • Windows Hosting Bulletin
    • Windows Hosting Leader
    • Windows Web Hosting Review
  • Tags

    Belgium Sharepoint 2013 Hosting Best sharepoint 2013 hosting Cheap and recommended sharepoint hosting cheap european sharepoint 2010 hosting cheap european sharepoint server 2010 hosting cheap europe sharepoint 2013 hosting cheap sharepoint 2010 europe hosting cheap sharepoint 2010 foundation hosting CSS in SPFx european sharepoint 2010 hosting European Sharepoint 2013 Hosting europe sharepoint 2013 hosting Europe Sharepoint Hosting fast SharePoint 2013 Hosting France Sharepoint 2013 Hosting free SharePoint 2013 Hosting Germany Sharepoint 2013 Hosting HostForLife HostForLife.eu Hosting cheap european sharepoint server 2010 hosting Hosting cheap europe sharepoint 2013 hosting Hosting europe sharepoint 2013 hosting Hungary Sharepoint 2013 Hosting india SharePoint 2013 Hosting Madrid Sharepoint 2013 Hosting Netherlands sharepoint 2013 hosting Norway Sharepoint 2013 Hosting Portugal Sharepoint 2013 Hosting recommended SharePoint 2013 Hosting Russia Sharepoint 2013 Hosting sharepoint 2010 europe hosting sharepoint 2010 foundation hosting sharepoint 2013 hosting SharePoint 2013 Hosting belgium SharePoint 2013 Hosting germany SharePoint 2013 Hosting Italy SharePoint 2013 Hosting netherlands SharePoint 2013 Hosting poland SharePoint 2013 Hosting review switzerland SharePoint 2013 Hosting UK SharePoint Hosting 2013 Paris Server Spain Sharepoint 2013 Hosting tips SharePoint 2013 Hosting Top Sharepoint 2013 hosting trick SharePoint 2013 Hosting
RSS Feeds XHTML 1.1 Top