Importing Active Directory profiles to SharePoint 2013

This post describes one way communication of Active Directory users to be brought into SharePoint 2013 environment.
We need an account set up for the AD profile synchronization. Let’s call it “SharePointADSync“, we need to configure a couple of things on this account in AD:


Add “Replicate Directory Changes” permission
  • On the domain controller, click Start, click Administrative Tools, and then click Active Directory Users and Computers.
  • In Active Directory Users and Computers, right-click the domain, and then click Delegate Control.
  • On the first page of the Delegation of Control Wizard, click Next.
  • In the Users or Groups page, click Add.
  • Type the name of the synchronization account, and then click OK.
  • Click Next.
  • In the Tasks to Delegate page, select Create a custom task to delegate, and then click Next.
  • On the Active Directory Object Type page, select This folder, existing objects in this folder, and creation of new objects in this folder, and then click Next.
  • On the Permissions page, in the Permissions box, select Replicate Directory Changes, and then click Next.
  • Click Finish

Follow these steps now to import AD profiles to SharePoint.

Go to Central Admin. Click Manage Service applications under Application Management.

From the list of services, click on the User Profile Service Application
Under Synchronization, click Configure Synchronization Settings

Select the “Use SharePoint Active Directory Import” radio button under Synchronization Options. Click OK to save settings. You will then be redirected to the User Profile page.
Under Synchronization, click Configure Synchronization Connections and create a new connection.

Fill in appropriate values and click Populate Containers. Once the containers are populated, check the ones you would like to import to SharePoint and save the connection. In the Account name, enter the SharePointADSync account details that we have created for this purpose. 
No you can go ahead and do a full import, which will import the selected profiles to your SharePoint.

Edit Top Navigation Branding within SharePoint 2013

Changing the default SharePoint branding on SharePoint 2013 sites is something which I am sure all of us would want to do. You would prefer seeing your organization name rather than SharePoint on your intranet/internet sites. I am placing a screenshot so as you know what I am talking about.




While I was looking to implement the same thing, I did a bit of research and thought the newly introduced Design manager might have something. But unfortunately it doesn’t. Finally I managed to change this using CSS. However there is one another easy peezee way of doing the same thing by using powershell script.

$webApp = Get-SPWebApplication “http://WebAppURL”
$webApp.SuiteBarBrandingElementHtml = "SharePointClick"
$webApp.Update()

Step by Step Installation guide for SharePoint 2013

Installing SharePoint 2013 is very simple and almost same steps as we had followed when we installed SharePoint 2010. In this post I will explain step by step installation on a Stand Alone system used for trial or development purposes.
I have already installed Windows Server 2012 in my VM so I am good to go for my SharePoint 2013 installation.
Download the ISO for SharePoint and mount it. For mounting, just right click and say Mount.

Let us install the Pre-requisites first. Follow the screenshots below for clarity.

 Check the Accept checkbox and click Next

 Sit back and wait for the pre-requisites to be installed

 Click Finish and restart your system

 Once you restart the installer will continue and finish the installation. Then its time to double click the Setup.exe and start installing SharePoint 2013. The first thing you will see is that it will ask you to enter your Product Key. Enter the key and click on Continue.

 Once again it will ask you to accept to their terms which anyways we all have to.

Select the Server type, in my case I wanted a Stand Alone as I use this for development purposes. You can select your case and say Install Now. 

By default SharePoint will be installed in your C drive, I recommend you do not change it. However if that is one of your requirement, you can do it now in the File Location tab.

 Sit back, relax and wait for the installation to finish

Installation is complete now and you can now configure your SharePoint 2013

Finally, the installation is complete and now you will be asked to create the first SharePoint 2013 site and bingo, you have installed SharePoint 2013 successfully. You can now browse to the Central Admin and create Web applications, site collections and dive into the deep SharePoint sea.

Like us on Facebook for more SharePoint 2013 updates.

Programatically breaking inheritance and adding unique permission to List Items

Permission handling is something which makes SharePoint a favorite product within the industry. SharePoint has Permission levels in built for basic roles, however you can create your own permission levels and assign to Groups and then set those groups to access any site/library/list. Whenever a sub-site is created, it asks you if you want to inherit the permission from the parent site or want to create unique permissions. 

If you choose to inherit the permissions, it will copy the same set of permissions to the sub-site which will again be passed on to the lists/libraries you create. It may happen that for securing our content, we want to break this inheritance and want to assign unique permissions to restrict the users for certain actions and to make the content more secure. Inheritance can be broken manually using the Out of feature also and if you have a business logic in place, you can do it programmatically also. This blog post gives you code to break inheritance for items meeting certain criteria and assigning permissions to them explicitly. I am using ItemAdded() event receiver to do this. You can use it within workflow or any custom webpart as well.

SPGroup securityGroup = spWeb.SiteGroups["Security Group Name"]; 
SPRoleDefinition groupRole = spWeb.RoleDefinitions["Read"];

SPRoleAssignment roleAssign = new SPRoleAssignment(securityGroup);
roleAssign.RoleDefinitionBindings.Add(groupRole);

SPListItem listItem = spWeb.GetListItem("http://List Item URL");
listItem.BreakRoleInheritance(true);
listItem.RoleAssegnments.Add(roleAssignment);
listItem.Update();