Thursday, August 9, 2012

Free ebooks: Great content from Microsoft Press.

Saturday, July 28, 2012

Configuring Multi-Tenancy in SharePoint 2010

Create a SubscriptionSettings Service Application and Proxy

Subscription settings service application is used to keep track of Multi - Tenant services and subscription ID's. So go to the below path

Start the  Microsoft SharePoint Foundation Subscription Settings Service

Central Administration => Application Management => Manage services on server
Start the service "Microsoft SharePoint Foundation Subscription Settings Service".

Create Service Application and Proxy via PowerShell

 $appPool  =  New-SPServiceApplicationPool -Name Subscription_Settings_Service_Pool -Account Domain\UserName

$sa = new-spsubscriptionsettingsserviceapplication –Name SubscriptionSettingsServiceApplication –Databasename SubscriptionSettingsServiceApplicationDB –applicationpool $appPool

$sap = new-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $sa

Create Tenant Administration site

New-SPSite –url "http://<servername>:<port no>/sites/Tenant Administration" –template "tenantadmin#0" –owneralias Domain\UserName –sitesubscription $subscription -AdministrationSiteType TenantAdministration

Create Member Site

Before creating the Member\Tenant Site enable the Self Service Site Creation of the Web Application.
Click Manage Site Collection under SharePoint Site Section on the Tenant Administration Site

Click New  and enter the required information  then click ok.

Reference :

Thursday, July 26, 2012

How to Find the SharePoint 2010 Installed version

Go to the Registry of the Below path and Identify the GUID of installed SKU's

HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\InstalledProducts
  • BEED1F75-C398-4447-AEF1-E66E1F0DF91E: SharePoint Foundation 2010
  • 1328E89E-7EC8-4F7E-809E-7E945796E511: Search Server Express 2010
  • B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0: SharePoint Server 2010 Standard Trial
  • 3FDFBCC8-B3E4-4482-91FA-122C6432805C: SharePoint Server 2010 Standard
  • 88BED06D-8C6B-4E62-AB01-546D6005FE97: SharePoint Server 2010 Enterprise Trial
  • D5595F62-449B-4061-B0B2-0CBAD410BB51: SharePoint Server 2010 Enterprise
  • BC4C1C97-9013-4033-A0DD-9DC9E6D6C887: Search Server 2010 Trial
  • 08460AA2-A176-442C-BDCA-26928704D80B: Search Server 2010
  • 84902853-59F6-4B20-BC7C-DE4F419FEFAD: Project Server 2010 Trial
  • ED21638F-97FF-4A65-AD9B-6889B93065E2: Project Server 2010
  • 926E4E17-087B-47D1-8BD7-91A394BC6196: Office Web Companions 2010 

use the below PowerShell command to get the GUID of the Installed SKUs.
 get-spfarm | select Products


Thursday, July 12, 2012

Rename a SharePoint Server machine name

There are number of concerns that contribute to defining the process that you will be taking to change a machine name for a SharePoint server.

Make sure you execute the following steps in order:

  • Run the following command:
    Stsadm.exe -o renameserver -oldservername <OLD_SERVER_NAME> -newservername <NEW_SERVER_NAME>
  • Rename the machine name from the computer properties
  • Reboot the machine
  • Update credentials (if required) if you are using domain accounts and the account didn’t change you can skip this step 
    stsadm –o updatefarmcredentials –userlogin <NEW_SERVER_NAME>\username -password ********
    stsadm –o osearch –farmserviceaccount <NEW_SERVER_NAME>\username -farmservicepassword ********

    stsadm –o spsearch –farmserviceaccount <NEW_SERVER_NAME>\username -farmservicepassword ********

    stsadm –o editssp –title “SHARED_SERVICE_TITLE” -ssplogin <NEW_SERVER_NAME>\username -ssppassword ********
  • Run the this command to reset the IIS: IISRESET /NOFORCE
  • Fix the Alternate access mappings
     If you are not able to get into the central admin site yet run the following command:
        stsadm -o addalternatedomain -url http://<OLD_SERVER_NAME>:<CENTRAL_ADMIN_PORT> -urlzone extranet –incoming url http://<NEW_SERVER_NAME>: <CENTRAL_ADMIN_PORT>

    Now you should be able to go to the central admin to clean the miss in the AAM. Basicly rename all the old server names into the new server name.
  • Now through the central administration or command line, make sure that you have the right credentials for the app pools (again if you are using domain users you shouldn’t worry about this at all)
  • Reboot the machine
  • Now run the SharePoint Products and Technologies configuration wizard to seal the deal
  • Reboot the machine
  • If you get the error related to SQL Server check your Database settings and make sure that they are correct. You can use stsadm to reset the config db name if the server name has changed and the same thing with the content DBs
  • If you do any changes to the DB settings make sure that your run: "IISRESET /NOFORCE" afterwards
  • After all that, if you have the db on the same machine as the sharepoint that means that you probably need to take care of the sql server settings (server name change) do run the following SQL Queries:
  •     -In case you use the default or no sql instance name:

    EXEC sp_dropserver '<OLD_SERVER_NAME>'
    EXEC sp_addserver '<NEW_SERVER_NAME>', 'local'
  •     -In case you use a custom sql instance name:
    sp_dropserver <’OLD_SERVER_NAME\instancename'>
    sp_addserver <'NEW_SERVER_NAME\instancename'>, local
  • Then restart the Sql Service to take effect

Wednesday, July 4, 2012

SharePoint supported languages, culture names and locale IDs

Download the language pack from

Language Name

Culture Name

Locale ID










Chinese (Simplified)



Chinese (Traditional, Taiwan)




























































Norwegian (Bokmål)






Portuguese (Brazil)



Portuguese (Portugal)









Serbian (Latin)
























Saturday, May 19, 2012

Insert flash/swf file in a master page

We can insert the flash/swf file in masterpage using the below code. 

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase=",0,40,0" id="sivaflash" style="width: 957px; height: 300px">
       <PARAM NAME=movie VALUE="/Style%20Library/siva/Banner.swf">
       <PARAM NAME=quality VALUE=High>
       <PARAM NAME=bgcolor VALUE=#ffffff>
       <param name="salign" value="T">
       <EMBED src="/Style%20Library/siva/Banner.swf" quality=High bgcolor=#ffffff
NAME="flash" ALIGN=""TYPE="application/x-shockwave-flash"
PLUGINSPAGE="" style="width: 957px; height: 300px" salign="T"></EMBED></OBJECT>

Thursday, May 10, 2012

All Language pack Code for Sharepoint 2010

Using the below power shell script to Download the Language Packs

Import-Module BitsTransfer
## Prompt for the destination path
$DestPath = Read-Host -Prompt "- Enter the destination path for downloaded files"
## Check that the path entered is valid
If (Test-Path "$DestPath" -Verbose)
    ## If destination path is valid, create folder if it doesn't already exist
    $DestFolder = "$DestPath\LanguagePacks"
    New-Item -ItemType Directory $DestFolder -ErrorAction SilentlyContinue
    Write-Warning " - Destination path appears to be invalid."
    ## Pause
    Write-Host " - Please check the path, and try running the script again."
    Write-Host "- Press any key to exit..."
    $null = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
## We use the hard-coded URL below, so that we can extract the filename (and use it to get destination filename $DestFileName)
## Note: These URLs are subject to change at Microsoft's discretion.
$UrlList = ("", #Arabic
            "", #Basque
            "", #Bulgarian
            "", #Catalan
            "", #Chinese Simplified
            "", #Chinese Traditional
            "", #Croatian
            "", #Czech
            "", #Danish
            "", #Dutch
            "", #English
            "", #Estonian
            "", #Finnish
            "", #French
            "", #Galician
            "", #German
            "", #Greek
            "", #Hebrew
            "", #Hindi
            "", #Hungarian
            "", #Italian
            "", #Japanese
            "", #Kazakh
            "", #Korean
            "", #Latvian
            "", #Lithuanian
            "", #Norwegian
            "", #Polish
            "", #Portugese (Brazil)
            "", #Portugese (Portugal)
            "", #Romanian
            "", #Russian
            "", #Serbian (Latin)
            "", #Slovak
            "", #Slovenian
            "", #Spanish
            "", #Swedish
            "", #Thai
            "", #Turkish
            ""  #Ukranian
ForEach ($Url in $UrlList)
    ## Get the file name based on the portion of the URL after the last slash and replace the word "Server" with a random string
    ## (Crude way of getting unique file names since all Lang Packs are ServerLanguagePack.exe)
    $DestFileName = $Url.Split('/')[-1] -replace "Server",(Get-Random)
        ## Check if destination file already exists
        If (!(Test-Path "$DestFolder\$DestFileName"))
            ## Begin download
            Start-BitsTransfer -Source $Url -Destination $DestFolder\$DestFileName -DisplayName "Downloading `'$DestFileName`' to $DestFolder" -Priority High -Description "From $Url..." -ErrorVariable err
            If ($err) {Throw ""}
            Write-Host " - File $DestFileName already exists, skipping..."
        Write-Warning " - An error occurred downloading `'$DestFileName`'"
## View the downloaded files in Windows Explorer
Invoke-Item $DestFolder
## Pause
Write-Host "- Downloads completed, press any key to exit..."
$null = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

Link to a Document in another folder in document library

Link to a document in a document library when the document is stored/Updated in document library

Follow the below steps to do Link to a document using OOTB.

We use the Content Type “Link to a Document” to link to a document that could be stored in another document library.
If the document library where you want to use the “Link to a Document” hasn’t been setup to use Content Types, you’ll have to click Settings, Document Library Settings, there you’ll need to access the Advanced Settings.

We need to add a Content Type, but before we can do this we’ll have to tell our Document Library that it can make use of different Content Types. Select “Yes” for the “Allow management of Content Types“.

When you return to the Document Library Settings, you’ll see a new section called Content Types, this is where we’ll add a new Content Type, click “Add from exisiting Content Type“.

The content type we need is “Link to a Document“, add it here.

When you return to your Document Library and click new, you’ll see that you have a new option to choose from, “Link to a Document“.

Let’s make a link to a Document in another Document Library, click “Link to a Document”. You’ll have to enter a name for the Link and enter the path to the Document you want to link to.

After confirming this is what your link looks like.

We made link to a document that’s saved in another document library, whenever you make a change to the master document, you don’t need to worry about the link, it will point to the changed document.

In the same way we can put "link to a document" links in another folder with in the Documnet library using Object Mode, Here i am using Event handler to Create Link to document when new item is Added in Document Library

using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;
using System.Text;

namespace LinkdocumentUrl.linktodocs
    /// <summary>
    /// List Item Events
    /// </summary>
    public class linktodocs : SPItemEventReceiver
       /// <summary>
       /// An item was added.
       /// </summary>
       public override void ItemAdded(SPItemEventProperties properties)
               using (SPSite site = new SPSite(properties.SiteId))
                   using (SPWeb web = site.AllWebs[properties.RelativeWebUrl])
                   //using (SPWeb web = site.OpenWeb(properties.RelativeWebUrl))
                       SPListItem _item = properties.ListItem;
                       //SPField field = properties.ListItem.Fields.GetFieldByInternalName("Make a Link");
                       SPFieldBoolean boolField = _item.Fields["Make a Link"] as SPFieldBoolean;
                       bool CheckBoxValue = (bool)boolField.GetFieldValue(_item["Make a Link"].ToString());

                       //if (_item["Make a Link"].ToString() == "true")
                       if (CheckBoxValue== true)
                           string documentUrl = web.Url + "/" + properties.ListItem.Url;
                           string documentName = properties.ListItem.DisplayName.ToString();
                           SPList list = web.Lists["TestDocs"];

                           if (list is SPDocumentLibrary)
                               SPDocumentLibrary docLib = (SPDocumentLibrary)list;
                               //string libraryRelativePath = list.RootFolder.ServerRelativeUrl;
                               //string libraryPath = site.MakeFullUrl(libraryRelativePath);

                               SPFolder folder = web.GetFolder(site.MakeFullUrl(list.RootFolder.ServerRelativeUrl) + "/Public");
                               SPFileCollection filecoll = folder.Files;

                               if (docLib.ContentTypesEnabled)
                                   SPContentType myCType = list.ContentTypes["Link to a Document"];
                                   if (myCType != null)
                                       //replace string template with values
                                       string redirectAspx = RedirectAspxPage();
                                       redirectAspx.Replace("{0}", documentUrl);

                                       SPFile file = folder.Files.Add(documentName + ".aspx", UTF8Encoding.UTF8.GetBytes(redirectAspx));

                                       SPListItem item = file.Item;
                                       item["ContentTypeId"] = myCType.Id;
                                       SPFieldUrlValue fieldUrl = new SPFieldUrlValue() { Description = documentName, Url = documentUrl };
                                       item["URL"] = fieldUrl;




       public static string RedirectAspxPage()
           //StringBuilder builder = new StringBuilder();

           const string format = @"<%@ Assembly Name='Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' %>
                                                <%@ Register TagPrefix='SharePoint' Namespace='Microsoft.SharePoint.WebControls' Assembly='Microsoft.SharePoint' %>
                                                <%@ Import Namespace='System.IO' %>
                                                <%@ Import Namespace='Microsoft.SharePoint' %>
                                                <%@ Import Namespace='Microsoft.SharePoint.Utilities' %>
                                                <%@ Import Namespace='Microsoft.SharePoint.WebControls' %>

                                                <html xmlns:mso='urn:schemas-microsoft-com:office:office' xmlns:msdt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'>
                                                <Head> <META Name='progid' Content='SharePoint.Link'>
                                                <!--[if gte mso 9]><xml>
                                                <mso:URL msdt:dt='string'>{0}, {0}</mso:URL>
                                                <mso:ContentType msdt:dt='string'>Link to a Document</mso:ContentType>
                                                        <form id='Form1' runat='server'>
                                                            <SharePoint:UrlRedirector id='Redirector1' runat='server' />
           StringBuilder builder = new StringBuilder(format.Length + 400);          
           builder.AppendFormat(format, typeof(SPDocumentLibrary).Assembly.FullName);          
           return builder.ToString();

Reference from

Monday, April 16, 2012

Creating multiple site collections in seperate databases and Managed Paths with PowerShell

The Below PowerShell Script to usefull to create Site Collection with diffrent Content Db also each site collection has a managed path (explicit inclusion) and some site collections are using diffrent Web templates.

$ErrorActionPreference = "Stop"

# Creating site collections.
$WebApps = "http://siva:9999" # enter web aplication name Example http://<server>:<port>
$WebApps_url = "http://siva:9999" # enter web aplication URL Example http://<server>:<port>
$db_server = "siva\sharepoint" # Pass the Server name
$owner_alias = "siva\siva.reddy" #Pass the User Name
$sitecoll_templates = @("STS#0","STS#1","STS#2","MPS#1","BLOG#0")
# Foreach loop to create site collections in array.

$SitesToCreate = @("siva1","siva2","siva3","Spblog","Meeting")
$ID = 0
foreach ($site in $SitesToCreate)
    $ID += 1  
    Write-Host "Creating site" $site "( ID =" $ID ")"
    $site_collection_db = "Test_Content_"+$site 
    Write-Host "Site Collectie Database = "$site_collection_db
    # The sitename will be converted to lowercase for the managedpath. 
    $siteToLower = $site.ToLower()
    $SiteColl_URL = $WebApps_url + '/' + $siteToLower
    Write-Host "Site Collectie URL =" $SiteColl_URL
    Write-Host " "
    # Creating content database for each site.
    New-SPContentDatabase $site_collection_db -DatabaseServer $db_server -WebApplication $WebApps
    Write-Host -ForegroundColor Yellow "Content database" $site_collection_db "has been created."
    # Creating managed path for each site collection.
    New-SPManagedPath -RelativeURL $site -WebApplication $WebApps -Explicit
    Write-Host -ForegroundColor Yellow "Managed path" $siteToLower "has been created."
    Switch ($site)
        "Meeting" { $sitecoll_templates = "MPS#1"}
        "Spblog" { $sitecoll_templates = "BLOG#0"}
        default { $sitecoll_templates = "STS#1" }
    # Creating site collection with the name defined by the Switch
    New-SPSite $SiteColl_URL -OwnerAlias $owner_alias -ContentDatabase $site_collection_db -Name $sitename -Template $sitecoll_templates -Language 1033
    Write-Host -ForegroundColor Yellow "Site collection" $site "has been created with the name" $sitename
    # Change status of content database to Disabled so the next site collection can be created in a new Online database.
    Set-SPContentDatabase -Identity $site_collection_db -Status Disabled
    Write-Host -ForegroundColor Yellow "The status of content database" $site_collection_db "is Disabled."

# Change the status of all created content databases to Online.
foreach  ($site in $SitesToCreate)
    $site_collection_db = "SP_Content_"+$site
    Set-SPContentDatabase -Identity $site_collection_db -Status Online
    Write-Host -ForegroundColor Yellow "Status of database" $site_collection_db "is Online."

Tuesday, April 10, 2012

Site Collection Content migration from one server to another

Please go through the below step for migrating the content Database of web application from one to another server.

Pre-Requisites :-

  1. SiteCollection Content Backup.
  2. Custom Solutions.
  3. Version of SharePoint & SQL server

Step to Migrate Content DB :-
  1. Create Web application on new SP Server.
  2. Create Site Collection under Web application.
  3. Detach the database from SQL Server.
  4. Restore the database with same name on SQL Server.
  5. Run the below command's on powershell
  6. Dismount-SPContentDatabase "<ContentDb Name>"
  7. Mount-SPContentDatabase "<ContentDb>" -DatabaseServer "<DbServer>" -WebApplication "<web application url>"
  8. Change the Site collection administrator for Web Application
  9. Deploy the solution.

    Tuesday, March 13, 2012

    Adding ,Deploying and Updating the Solutions

    Visual Studio 2010 makes it really easy to add and deploy solutions when you are developing, but you may eventually want to deploy those solution packages elsewhere right?  We can still use stsadm, but that is effectively considered deprecated now in favor of PowerShell.  In the past to add a solution, we used an stsadm command like the one below.  In today’s example, we’ll be working with a package called SharePointProject2.wsp on my server named sp2010.
    stsadm –o addsolution –name SharePointProject2.wsp
    To get started with PowerShell, run the SharePoint 2010 Management Console located in your Microsoft SharePoint 2010 Products folder on your start menu.  This automatically loads the Microsoft.SharePoint.PowerShell snappin so that we can execute SharePoint commands.  To install a solution we use the Add-SPSolution command.  If you are using a Sandboxed solution you would use Add-SPUserSolution instead.  It takes just one parameter, –literalpath, which is the path to the solution file.  One thing that is different is that you must specify the full path to the file for some reason.  I haven’t been able to get it to take a path to the solution in the current folder even if I make use of .\ before the filename.  Here is an example.
    Add-SPSolution c:\code\SharePointProject2\bin\debug\SharePointProject2.wsp
    In this case you don’t actually have to type –literalpath before the parameter.  This is what it looks like when executed.  You can see that it displays the id of the solution along with its deployment status.
    Now we need to deploy the solution.  In the past, we used an stsadm command like the following.
    stsadm –o deploysolution –name SharePointProject2.wsp –url http://moss-server –allowCasPolicies –immediate
    We would also follow this up with a call to stsadm with the execadmsvcjobs operation.  To do the same operation in PowerShell, we use the Install-SPSolution command (again use Install-SPUserSolution for Sandboxed solutions).  You can use the Get-Help command (i.e.: Get-Help Install-SPSolution) to get more information on a command but it’s not always obvious what it is expecting as you can see below.  That is why I am writing the post today.
    The first parameter you need is the –Identity parameter.  This is the name of the solution package (i.e.: MySolution.wsp).  Depending on if you are using the GAC or Code Access Security, you will specify either –GACDeployment or –CASPolicies.  You then need to specify a specific web application using the –WebApplication parameter or –AllWebApplications to deploy it to all web applications (assuming the manifest allows it).  If you need to force the deployment, you can still use the –Force command.  Here is what an install command might look like.
    Install-SPSolution –Identity SharePointProject2.wsp –WebApplication http://sp2010 -GACDeployment
    I’ll point out that executing this command actually does do the deployment operation.  You don’t have to fire off something to execute a job later like you did with stsadm.
    You might want to update your solution, so we’ll talk about how to do that as well.  Here is what your stsadm command might have looked like in WSS3.  Which would also be followed up with an execadmsvcjobs operation.
    stsadm –o upgradesolution –name SharePointProject2.wsp –filename SharePointProject2.wsp –immediate –allowCasPolicies
    The upgrade solution syntax is similar to the others.  We just have to specify an identity and a literalpath with the Update-SPSolution command.  The identity is the name of the package on the server to upgrade and the literalpath is the full path to the new solution package on the file system.  Here is what that might look like.
    Update-SPSolution –Identity SharePointProject2.wsp –LiteralPath c:\code\SharePointProject2\bin\debug\SharePointProject2.wspGACDeployment
    We’ve talked about everything else, so we’ll finish it up by talking about retraction and removal.  To retract a solution we use the Uninstall-SPSolution command.  By now you are probably noticing a pattern in the way things are named.  Install –> Deploys, Uninstall –> Retracts.  It also just uses the -Identity parameter and the –WebApplication parameter.  You can also use the –AllWebApplications parameter to retract it from all web applications. Many of these commands may prompt you with an “Are you sure?” type prompt.  You can skip this prompt by adding a –confirm parameter.  Here is what it looks like.
    Uninstall-SPSolution –Identity SharePointProject2.wsp –WebApplication http://sp2010
    Lastly, to remove the package from the solution store, we use the Remove-SPSolution command.  It just takes the name of the package.
    Remove-SPSolution –Identity SharePointProject2.wsp
    I hope this helps.  If you’re like me, it’s one thing to see the docs on something, but I like to see real examples.  There aren’t any examples in the Get-Help command yet.  This should cover all of the common commands that you probably used to used with stsadm in regards to solution deployment.  The nice thing is that you can script these things together very easily and create highly flexible PowerShell scripts.  Expect a few more posts soon on the basics of working with PowerShell and SharePoint 2010.

    Ref by

    Saturday, February 25, 2012

    Creating the subsite's automaticallty by choose custom template in Sharepoint 2010

    In Sharepoint 2010 no option avilabe to save all subsite to site template uisng save as template option like moss 2007, we can achive this to create feature for  WebProvisioned Event to create subsite in site creation it self in sharepoint 2010..

    public override void WebProvisioned(SPWebEventProperties properties)
               SPWeb currentWeb= properties.Web as SPWeb;
               // check  the selected custom template

    Creating Subsite

     public static void CreateSubsites(SPWeb web)
               Hashtable templatewebInformation = new Hashtable();
               templatewebInformation .Add("URL", "siteurl");
               templatewebInformation .Add("TemplateName", "template name");
               templatewebInformation .Add("Title", "site title");
               templatewebInformation .Add("Description", "site Description");
               templatewebInformation .Add("LCID", "1033");
               SPWeb temlateNewWeb = CreateSite(web, templatewebInformation );

              Hashtable templatewebInformation1 = new Hashtable();
               templatewebInformation1 .Add("URL", "siteurl1");
               templatewebInformation1 .Add("TemplateName", "template name1");
               templatewebInformation1 .Add("Title", "site title1");
               templatewebInformation1 .Add("Description", "site Description1");
               templatewebInformation1 .Add("LCID", "1033");
               SPWeb temlateNewWeb = CreateSite(web, templatewebInformation1 );

    Creating the Site
    public static SPWeb CreateSite(SPWeb web, Hashtable webInformation)
               SPWeb newWeb = null;
               if (webInformation["TemplateName"] == null)
                   return newWeb;
               SPDocumentLibrary solutions = (SPDocumentLibrary)web.Site.GetCatalog(SPListTemplateType.SolutionCatalog);
               // Get Web Template
               SPWebTemplateCollection webTemplates = web.Site.RootWeb.GetAvailableWebTemplates(1033);
               SPWebTemplate webTemplate = null;
               foreach (SPWebTemplate item in webTemplates)
                   if (item.Name.Contains(webInformation["TemplateName"].ToString()))
                       webTemplate = item;
               if (webTemplate != null)
                   if (webInformation["URL"] == null)
                       return newWeb;
                   string URL = webInformation["URL"].ToString().Trim();
                   if (string.IsNullOrEmpty(URL))
                       return newWeb;
                   string title = webInformation["Title"] == null ? URL : webInformation["Title"].ToString();
                   string description = (webInformation["Description"] == null) ? string.Empty : webInformation["Description"].ToString();
                   uint LCID = (webInformation["LCID"] == null) ? 1033 : Convert.ToUInt32(webInformation["LCID"]);
                   bool useUniquePermissions = false;
                   bool bConvertIfThere = false;

                   using (SPWeb subWeb = web.Webs.Add(URL, title, description, LCID, webTemplate, useUniquePermissions, bConvertIfThere))
                       subWeb.Navigation.UseShared = true;
                       newWeb = subWeb;
               return newWeb;