SharePoint how to refer file URL in client side script

In SharePoint, sometime user finds it difficult to refer URL for any file in client side scripting languages like jQuery/javascript, so in this post I am sharing how to refer different level of sites using tilde (~). ~site: is used to refer to current site URL. ~sitecollection: is used to refer the current site collection …

Continue reading ‘SharePoint how to refer file URL in client side script’ »

How to check Column Internal Name for a SharePoint List

In a SharePoint list, we usually use the user friendly (readable) names in list columns or fields. Each column has a display name and internal name which we also call as physical name of the filed. Just like Title, Description, Full Name. There internal names are like Column Display Name Column Internal Name Title Title …

Continue reading ‘How to check Column Internal Name for a SharePoint List’ »

SharePoint: Difference between List.items.Count and List.ItemCount

The basic difference between List.items and List.ItemCount  is that list.items returns total no. of list items excluding folders while list.ItemsCount return total no. items in a list including folders. Check SPList.ItemCount property Check SPListItemCollection.Count property When we compare List.items.Count vs List.ItemCount then one more major difference between them is that List.Items.Count shows only those items …

Continue reading ‘SharePoint: Difference between List.items.Count and List.ItemCount’ »

SharePoint how to lock and unlock a site collection

Making a site read-only (also known lock) is required most of the time when you are going to migrate to newer version and restrict user for any modifications. This is most of the time required over cut over migration. If you have to lock a web application read-only which contain multiple site collections then you …

Continue reading ‘SharePoint how to lock and unlock a site collection’ »

Get Query String parameters using JavaScript

In SharePoint, we use custom client side script (jQuery) to load or submit content on a page, some time we also need to get few values from Query string. There are multiple ways of doing that, here I am going to share a function to which you just need to pass the query string field …

Continue reading ‘Get Query String parameters using JavaScript’ »

SharePoint: Get list of all users using PowerShell script

I was having a requirement to get list of all users which have permissions on a sharePoint site and also on any specific list using PowerShell script. You can download script file from Technet Gallery. Open Windows PowerShell Integrated Scripting Environment, and copy below script. [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) > $null $SiteCollectionURL = “http://sp2013:1111″ $site = new-object Microsoft.SharePoint.SPSite($SiteCollectionURL) $web …

Continue reading ‘SharePoint: Get list of all users using PowerShell script’ »

SharePoint: Get SPField details for SharePoint Lists using PowerShell

I have seen multiple posts on different forums to get details of list columns (like field type) for all SharePoint Lists or any specific list. I also uploaded script to Technet document gallery . This PowerShell script will show the fields defined in list Views. But with a little modification in code you can get …

Continue reading ‘SharePoint: Get SPField details for SharePoint Lists using PowerShell’ »

Create SharePoint Site (SPWeb) using Custom Template and PowerShell

I got a task to setup company’s hierarchy using our own custom created site template. My first priority is to achieve this task through PowerShell. Creating site collection or sub site through PowerShell is fairly a simple task, the command for creating sub site is New-SPWeb http://sharepoint/subweb1 -Template “STS#0” Ref: http://technet.microsoft.com/en-us/library/ff607579(v=office.15).aspx I tried to replace …

Continue reading ‘Create SharePoint Site (SPWeb) using Custom Template and PowerShell’ »