Thursday, July 25, 2013

PowerShell Command to Export Sub Site


Export site with these option. This will include all customizations, user securities, list & libraries etc.

Export-SPWeb -Identity http://sharepoint-demo/IC -Path "c:\bkup\IC.cmp" -Force -IncludeUserSecurity -IncludeVersions All


Note :
·         http://sharepoint-demo/IC : You can change this site url. Put url of site which is going to be backed up.
·         C:\backup\IC.cmp : You can change backup path with file name. You have to keep extention .cmp as it is.




Tuesday, July 23, 2013

What is Managed Path in SharePoint

Let’s understand what is path first. In SharePoint you have seen some different types of site collection urls within same Web Application like :
·        http://sharepointDemo


These different kind of URL structure called path & you can manage these path as per you your organization hierarchy or architecture. Some time you required to create a site collection with name of “Departments” & under this “Department” you might want to create some departments like HR, IT etc. and you want your site collection url should be like http://SharePointDemo/Departments/HR.

Managed path is this. Where you can manage site collection path not whole url. Here you can Manage Path for the selected Web Application.

In other words, when you creates your first site collection in Web Application you have to provide site collection url under section “Web Site Address”. Here you get options “/”, “/Sites/” and”/My/Personal”, These options are called Managed Path.

There are two types of managed path in SharPoint :

Explicit: When we want only one site collection with a managed path, We use this option.  When you create Managed Path with Explicit option, You can’t add any further url like you want to create a site collection directly for HR then you have to create a managed path with explicite option. When you will going to create site collation & selecting managed path from “Web Site Address”, you will get an additional URL option.

    Wildcard : When we want to create more than one site collection under a specific managed path, we use this option.  Like we have created managed path Department with Wildcard option. Now I want to create HR site then my url will be : http://SharePointDemo/Departments/HR

Thursday, July 11, 2013

Update for Microsoft Project Server 2013 (KB2768001)

Applies: Project Server 2013; SharePoint Server 2013
Due to a change in the package configuration introduced after SharePoint 2013 RTM the March Public update is a mandatory requirement in order to install subsequent SharePoint Updates.
Download from Microsoft


Monday, July 1, 2013

Get web.config file in timer job

I was working on timer job & wanted to get data from sql server. To achive this goal, I add my database connection string in web application’s web.config file.

Now I used the following code to get web.config setting from timer job :

private string getConnectionString()
        {
            return System.Configuration.ConfigurationManager.AppSettings["MyAppSettingKey"];     
  }

But this code was not able to get the web.config file.

Why?

I started some R & D on it & found that Time Job runs under OWSTimer.exe & Web Application runs under W3WP.exe. As the context of  Both are different so we have to use WebConfigurationManager to get specific SharePoint Web Application configuration.

private string getConnectionString(string webAppName)
        {
            System.Configuration.Configuration webConfiguration = WebConfigurationManager.OpenWebConfiguration("/", webAppName);

            return webConfiguration.AppSettings.Settings["MyAppSettingKey "].Value;
        }

This code is working in Timer Job.