Identify Unique permission of a Web Site

The following example CSOM code snippet returns the Boolean value to identify the site has inherited permission or unique permission.

Web.HasUniqueRoleAssignments returns true, if the website has the unique permission
Web.HasUniqueRoleAssignments returns false, if the website is inherited the permission from the parent site.

Add the below reference dlls to the Visual Studio solution

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint.Client;
using System.Net;

namespace IdentifyWebPermission
class Program
static void Main(string[] args)
//Get Site Url fro user
Console.Write("Enter Site URL: ");
string strURL = Console.ReadLine();

//Get Username from user in the format of (Domain/Login ID)
Console.Write("Enter UserName (domain/userid): ");
string strUserName = Console.ReadLine();

Console.Write("Enter your password: ");
string pass = getPassword();

ClientContext ctx = new ClientContext(strURL);
ctx.Credentials = new NetworkCredential(strUserName, pass);
Web web = ctx.Web;
//Parameters to receive response from the server
//HasUniqueRoleAssignments property should be passed in Load method to get the value
ctx.Load(web, w => w.HasUniqueRoleAssignments, w => w.Title);
Console.WriteLine("Site \""+ web.Title+ "\" has Unique Permission: "+ web.HasUniqueRoleAssignments);

private static string getPassword()
ConsoleKeyInfo key;
string pass = "";
key = Console.ReadKey(true);
// Backspace Should Not Work
if (key.Key != ConsoleKey.Backspace && key.Key != ConsoleKey.Enter)
pass += key.KeyChar;
if (key.Key == ConsoleKey.Backspace && pass.Length > 0)
pass = pass.Substring(0, (pass.Length - 1));
Console.Write("\b \b");
// Stops Receving Keys Once Enter is Pressed
while (key.Key != ConsoleKey.Enter);
return pass;

Remote Identification of SharePoint Version

SharePoint has lot of hidden files and methods which provides lot of information about the server and sites. Now we can see one of the hidden area from the vast of SharePoint Sea.

SharePoint sites has the hidden file which helps to identify the version of SharePoint Server. We can access the below file from any browser to get the information.


This allows to identify the SharePoint version remotely.

We can get the information by viewing the html source of the browsed above location.

View Source of http://sharepoint-site/_vti_inf.html (SharePoint 2010 Sites)
<!– FrontPage Configuration Information

View Source of http://sharepoint-site/_vti_inf.html (SharePoint 2016 Sites)
<!– FrontPage Configuration Information

SharePoint provides another configuration file to get the accurate version of SharePoint site installed to the server by accessing


Result for SharePoint 2010

Result for SharePoint 2016

Happy learning :)

First version of SharePoint 2016 released

There is good news, Microsoft have released the SharePoint 2016 in a preview version on 24th of August 2015. Before the Ignite 2015 event Microsoft announced the release about next on premise environment SharePoint 2016 will become generally available on Q2 2016 and public beta is planned for Q4 2015.

After couple of months, there is a word spread over the world that beta version of SharePoint 2016 version would be proponed to August 2015 instead of Q4 2015. And the time comes on August Monday 24th; a link to the “Announcing availability of SharePoint Server 2016 IT Preview and cloud hybrid search” article is spread over the twitter, then I realized a public preview of SharePoint 2016 got released to the public.

A video talks about the availability of SharePoint 2016 preview

Here, I have listed the available download links from Microsoft download center
SharePoint Server 2016 Preview
Link to ISO file format of SharePoint 2016 preview Installation file.

SharePoint Server 2016 IT Preview Quick Start Guide
This quick start guide provides an overview of SharePoint Server 2016 IT Preview requirements and installation to support Single Server Farm installations

SharePoint Server 2016 IT Preview Reviewer Guide
The SharePoint Server 2016 IT Preview Reviewer Guide provides an overview of new capabilities in SharePoint Server 2016 IT Preview.

SharePoint Server 2016 IT Preview Datasheet
The SharePoint Server 2016 IT Preview Datasheet provides an overview of new capabilities and investments in SharePoint Server 2016 Preview.

Apps for SharePoint

Apps for SharePoint

Microsoft places the lot of apps for the SharePoint and Office products. All the apps can be accessible from the location at office store. From the listed of all apps I have extracted the SharePoint apps, which comes around 891 as of today (7th Aug 2015).

Click SharePoint Apps, to download the file which has the list of apps with the pricing details.

Will come soon with new and more information….. :)

Tips - Time Zone Collection

SharePoint Time Zone Collections from Regional Settings Page

Today I have something new in my plate, ie., explore new CSOM package release for Office 365. So I have downloaded the package as mentioned in that post and tried some coding stuff(will publish the detail post later).

From the release, they have mentioned some key updates as listed below,

  • Manage regional settings of a site
  • Manage language settings of a site
  • Manage auditing settings of a site
  • Control advance settings for document sets
  • Support for upcoming enhanced migration APIs
  • Control sandbox solution settings in site collection level
  • Secondary contact in site collection level
  • Sharing settings

Based on the updates, I got interested in Regional settings and that is the first one they have mentioned. So I started with that.

I always do some navigation stuff before start the coding. Same like that, today also I have navigated to Regional Settings page by navigating Site Settings > Regional Settings (under Site Administration ) and investigate how the SharePoint behaves in OOTB.

I have very much interested in manipulating the DOM element through browser developer tools and play with it. Same way today also I have opened the developer tool and explored the time zone dropdown control and start investigate that select element. wow.. it contains a lot of child elements with the timezone information (Id and Description).

Currently I have two trial accounts one from SharePoint Online and another one from Rackspace to validate weather the id and description are same for both the environments.

Both the environments has the same Id and description for the Time Zone Collections. So here comes the hack to get the ids for each timezone.

Explore TimeZone Collection

Explore TimeZone Collection

Get the Select element id and use the below javascript code to get the entire collection of time zones.

var timezones = document.getElementById("ctl00_PlaceHolderMain_ctl01_ctl01_DdlwebTimeZone").children;
var i;
for(i=0 ; i< timezones.length; i++){ console.log(timezones[i].getAttribute('Value') +" \t " + timezones[i].innerHTML ); }

Fetch Timezone Collections

Fetch Timezone Collections

The same way, we can do lot of tricks in sharepoint pages to get the different type of information. Start explore the SharePoint in different angle (Look for different angle – Dialogue from Big Hero 6 movie). :)

Azure Services Free Trial

Azure Services and my thoughts

Two weeks before, I got some interest in Azure Services after seeing lot of tweets (@ktskumar) my following list, videos from and more blogs. Those things got my attention and so I thought to try out other than SharePoint and its related stuffs.

I got this link Microsoft Azure: Cloud Computing Platform and Services when I google “Azure Services” but for the same term I got this link in bing search Directory of Azure Cloud Services | Microsoft Azure as a first result item. This is not I want to talk about, so we continue on azure links,

I have no idea on which one to follow, so I opened the both of the links and got lot of information on both sites.
1. Directory of Azure Cloud Services | Microsoft Azure
This page lists out the various services available in Azure services with some information. As per site they have 3 popular services App Service, SQL Database, and Virtual Machines

2. Microsoft Azure: Cloud Computing Platform and Services
This site shows the solutions provided by Azure cloud platform with three video series links
Get Started – Redirect to the page has 3 mins video teach about how to quickly start with Azure
Free Webinars – Register and view the available webinar videos.
Azure Friday – 10 min weekly video series presented by Scott Hanselman

Now we come to the main picture, that to try out a Azure by clicking on Free Trial (this link is available in both sites). That link redirect us to

Azure Services Free Trial

Azure Services Free Trial

Ofcourse as I am developer want to explore the Azure Services, so I clicked “Try it Now” instead of buy now option. That redirects me to sign in page, there I have given my Microsoft account details (I already have, if we didn’t have one, that page provides the option for user to signup).

Once I have given right credentials, we will be redirect to There we have asked to fill the
About You
Automatically populates user’s information and provides the option to change those information
Mobile Verification
Verified with my registered mobile
Payment Details
They are saying this is for verification purposes. As a beginner to Azure Services wants to explore it, why I have to share my Credit card information?. Still I haven’t fill the details and I couldn’t see anywhere in the page says its a mandatory.
Declaration with Sign Up button
Selected “I Agree” check box and clicked the Sign Up button.

Azure Services Sign Up

Azure Services Sign Up

During the button click event nothing happens like redirection, instead it asking us to fill the Payment information.

Here how could the beginner developer or fresh person came to explore or develop applications on Azure would provide the credit card details to start? This is like a barrier on starting Azure Services for the head start.

I am in the middle of the area, about to try this or not. Stay tuned on my blog to have more information.

Enable USB File Transfer on Android Lollipop

Use this tutorial to successfully connect the USB file transfer from Android device and Computer.

  1. Go to Settings > Storage
  2. In the Storage option, tab the three vertical dotsthreedots in top to have “USB Computer Connection” option


  3. Tab that “USB Computer Connection” fly-out menu

    USB computer connection

    USB computer connection

  4. From the connection view, check any of the below options to transfer files between the computer and android device.
    • Media Device (MTP) – Option used to enable files in computer
    • Camera (PTP) – Option used to enable transfer phots using camera software and also transfer the file with computers that don’t support MTP

    USB computer connection options

    USB computer connection options

Now connect the Android device with the Computer using USB cable to transfer files.

Cheers :)

Restore deleted Top-Level Site or Site Collection

If the site collection user accidentally deletes the top level site, the site collection also gets deleted. This will restrict the user to access the top level site and even sub sites from the site collection.
SharePoint Recycle bin feature doesn’t available for restore the deleted site collection.
Bu SharePoint 2013 provides the another option to restore the deleted site collection,

Whenever the site collection was deleted, the object is removed from SPSite and able to access using SPDeletedSite.To get the site collection back, we have to give Site Collection Id as input.

PowerShell command to Get the deleted Site Collection:
Get-SPDeletedSite < Site Collection server relative URL >
Get-SPDeletedSite –Identity < Site Collection ID >

PowerShell command to restore the deleted Site Collection:
Restore-SPDeletedSite -Identity < Site Collection ID >

Get Permission Levels associated with all Groups in Site – 1

In this post, I will show you have to get the permission level for the Groups associated to the Web Site Level using the Managed Client Object Model.
Managed Client Object Model – Get Permission Levels associated with all Groups in Site

  1. I have my code which supports the Console Application, so create the Console Application in C# Section from Visual Studio.
  2. Then add the Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll references. We can obtain those two dll’s from below methods,
    1. From 14 Hive / ISAPI Folder (If we installed SharePoint 2010 in your machine)
    2. If SharePoint 2010, not available on the machine; install “SharePoint Foundation 2010 Client Object Model Redistributable” to get those dll’s.
  3. Open the code page and add the following code,

The following code example displays in a console application, the Permission Levels associated to the Groups for the specified Site.

string siteURL = "http://SiteUrl";
string username = "username";
string password = "password";
string domain = "domain";

ClientContext ctx = new ClientContext(siteURL);
ctx.Credentials = new System.Net.NetworkCredential(username, password, domain);
Web webSite = ctx.Web;

//Following Load method loads,
//Line 2: Identify the website has Unique Perimission or Inherited Permission
//Line 3: Get the WebSite Title Property
//Line 4: Get the collection of RoleAssignment, associated to the Site
//Get the Member and (collection of RoleDefinition) RoleDefinitionBindingCollection property from RoleAssignment
//Line 5,6: Member Property retrives the Title and Id
//Line 7,8: RoleDefintion retrives the Title Property

//Start: Line 0
ctx.Load(webSite, oweb =>
oweb => oweb.Title,
oweb => oweb.RoleAssignments.Include(
roleAssignment => roleAssignment.Member.Title,
roleAssignment => roleAssignment.Member.Id,
roleAssignment => roleAssignment.RoleDefinitionBindings.Include(
roleDefinition => roleDefinition.Name)));

//End: Line 9


//Code for Output Follows
RoleAssignmentCollection roleAssCollection = webSite.RoleAssignments;
Console.WriteLine("Site Title: " + webSite.Title);
Console.WriteLine("Site has Unique Permissions: " + webSite.HasUniqueRoleAssignments);
Console.WriteLine("Group Name \t Group ID \t Permission Level");
foreach (RoleAssignment roleAss in roleAssCollection)
Principal roleMember = roleAss.Member;
Console.Write(roleMember.Title + " \t " + roleMember.Id + " \t ");
foreach (RoleDefinition roleDef in roleAss.RoleDefinitionBindings)
Console.Write(roleDef.Name + ";");
catch (Exception ex)

I have uploaded this Code and Executable file in CodePlex with a project named as SharePoint Permissions

File Upload Control Validation not working in firefox

I have tried to validate the File Upload Control to Upload only Video files. I have used the following validation expression in Regular Expression Control.


The above validation is working in IE and Chrome, but the Firefox not supported this expression.
So I googled for that, and I found a useful link
By referring the above link, I have modified my expression as follows


After saving the page and I tested and got worked in all browsers.

After updating, the Regular expression control looks like as follows,

<asp:RegularExpressionValidator ID=”RegularExpressionValidator1″ runat=”server”
ErrorMessage=”Only video files are allowed.”
ControlToValidate=”fileUploadControl” >
Only Video files are allowed