Showing posts with label Sharepoint2010. Show all posts
Showing posts with label Sharepoint2010. Show all posts

Thursday, March 12, 2015

ListView Day Filter in SharePoint

There was a query at technet forum , "Requirement to show "Daily" stats on a custom list.  Criteria are to show items modified between 3pm yesterday to 3pm today. "

Solution -  

1- Create a Calculated column in list. The formula should be  -
  • Name - ModifiedHrs
  • Type - Calculated
  • Formula:     =HOUR(Modified)
  • Format -Number (1, 1.0, 100)
    Number of decimal places:  0
2- Create a Tabular View ( e.g. DayState.aspx) for List. (not Calendar View), through browser with filter ( Modified equal to [Today]).
3. Now Open the view page (DayState.aspx) in SharePoint Designer code view [Edit in Advance Mode]
4. Locate the CAML query associated with the filter (Modified = [Today]), you can find something like

<WebPartPages:WebPartZone ---
<WebPartPages:XsltListViewWebPart ----
-----
<XmlDefinition>
<View --->
<Query>
<OrderBy>--</OrderBy>
<Where>
<Eq>
<FieldRef Name="Modified"/>
<Value Type="DateTime"><Today/></Value>
</Eq>
</Where>
</Query>
<ViewFields---->
----
</View></XmlDefinition>
</XmlDefinition>




5. Replace the <Where>----</Where> Section with this one

<Where>
<Or><And><Eq><FieldRef Name="Modified"/>
<Value Type="DateTime"><Today OffsetDays="-1"/>
</Value></Eq><Gt><FieldRef Name="ModifiedHrs"/>
<Value Type="Number">14</Value></Gt></And>
<And><Eq><FieldRef Name="Modified"/>
<Value Type="DateTime"><Today/></Value></Eq><Lt>
<FieldRef Name="ModifiedHrs"/>
<Value Type="Number">16</Value></Lt></And></Or>
</Where>
 
6. Save the page , and test in browser

Thursday, August 29, 2013

Create New Secure Store Service Application ID in SharePoint 2010 using PowerShell


Use CreateSecureStoreApplicationID function to new SharePoint Secure Store Application ID using Powershell.

Parameters : 
  1. $sssName - Mandatory - SharePoint Web Url - e.g. http://server:port/ 
  2. $sssFriendlyName - Mandatory - SharePoint Library Name 
  3. $sssContactEmail - Mandatory - File Path on hard drive , e.g. .\abc.xlsx
  4. $sssAdminIdentity
  5. $sssAdminPassword
  6. $defaultServiceContextUrl


function CreateSecureStoreApplicationID
{

[CmdletBinding()]
    Param(
    [Parameter(Mandatory=$true,ValueFromPipeline=$true)]
    [string]
$sssName,
    [Parameter(Mandatory=$true)]
    [string]
$sssFriendlyName,
    [Parameter(Mandatory=$true)]
    [string]
$sssContactEmail,
    [Parameter(Mandatory=$true)]
     [string]$sssAdminIdentity,
    [Parameter(Mandatory=$true)]
    [string]
$sssAdminPassword,
    [Parameter(Mandatory=$true)]
    [string]
$defaultServiceContextUrl
    )
    


    Start-SPAssignment -Global  
    $SecureStoreServiceInstances = Get-SPServiceInstance | ? {$_.GetType().Equals([Microsoft.Office.SecureStoreService.Server.SecureStoreServiceInstance])}
    $SecureStoreServiceInstance = $SecureStoreServiceInstances | ? {$_.Server.Address -eq $env:COMPUTERNAME}
    If (-not $?)
    {
    Throw " - Failed to find Secure Store service instance"
    }  

    if ($SecureStoreServiceInstance.Status -eq "Disabled")
    {
        Throw "-Secure Store Service Application is disabled"
    }
       
    $defaultServiceContext = Get-SPServiceContext $defaultServiceContextUrl
    try
    {
    $ssApp = Get-SPSecureStoreApplication -ServiceContext $defaultServiceContext -Name $sssName -ea "SilentlyContinue"
    if ($?)
    {
      Write-Host "."
    }
    else
    {
       Write-Host "."
       throw $error[0].Exception
    }
    }
    catch
    {
        $ssApp = $null
    }
    if ($ssApp -ne $null)
    {
    Write-Host -f yellow "Secure Store Service Application $sssName already exists"
    return
    }
    Write-Host -f yellow "Creating new Secure Store Application Id"
    $UserNameField = new-spsecurestoreapplicationfield -name "Windows UserName" -type WindowsUserName -masked:$false
    $PasswordField = new-spsecurestoreapplicationfield -name "Windows Password" -type WindowsPassword -masked:$true
    $fields = $UserNameField, $PasswordField   
   
    $targetApp = new-spsecurestoretargetapplication -Name $sssName -FriendlyName $sssFriendlyName -ContactEmail $sssContactEmail -ApplicationType Group

    $targetAppAdminAccount = New-SPClaimsPrincipal -Identity $sssAdminIdentity -IdentityType WindowsSamAccountName
   
   
    $ownerClaims = New-SPClaimsPrincipal -EncodedClaim "c:0(.s|true"  
   
    $ssApp = new-spsecurestoreapplication -ServiceContext $defaultServiceContext -TargetApplication $targetApp -Administrator $targetAppAdminAccount -Fields $fields -CredentialsOwnerGroup $ownerClaims
      
    # Set credential (username, password) for SSS
    $ssApp = Get-SPSecureStoreApplication -ServiceContext $defaultServiceContext -Name $sssName
    $credSecValue1 = ConvertTo-SecureString $sssAdminIdentity -AsPlainText -Force
    $credSecValue2 = ConvertTo-SecureString $sssAdminPassword -AsPlainText -Force
    $credentialValues = $credSecValue1,$credSecValue2
    write-host -f Green "Success"   
    # Fill in the values for the fields in the target application 
    Write-Host -f yellow "Updating Secure Store Application $sssName Identity Credential Values"
    Update-SPSecureStoreGroupCredentialMapping -Identity $ssApp -Values $credentialValues 
    write-host -f Green "...Success"


    Stop-SPAssignment -Global 

}


Function  Calling -


$sssName = "SecureStoreName"$sssFriendlyName = "Secure Store Friendly Name"
$sssContactEmail = "Email@abc.com"
$sssAdminIdentity = "domain\user"
$sssAdminPassword = "Password"
$defaultServiceContextUrl = "http://server:port/" 
   
CreateSecureStoreApplicationID $sssName $sssFriendlyName $sssContactEmail $sssAdminIdentity $sssAdminPassword $defaultServiceContextUrl


Monday, August 26, 2013

Add Excel Web Access WebPart Using PowerShell


Use Add-EWAWebPart function to add a Excel Web Access webpart in a SharePoint page using PowerShell script.

Parameters : 
  1. $webUrl - Mandatory - SharePoint Web Url - e.g. http://server:port/ 
  2. $ExcelFileURL - Mandatory - Excel File URL 
  3. $pageRelativeUrl - Mandatory - SharePoint WebPart Page Relative Url , e.g. "Library/page.aspx"
  4. $zone - MandatoryThe WebPartZoneBase that webPart is being added to.e.g. Left, Right
  5. $zoneIndex - Mandatory - An integer that represents the ordinal position that webPart occupies in zone, relative to other controls in zone.
function Add-EWAWebPart
{   
    [CmdletBinding()]
    Param(
    [Parameter(Mandatory=$true,ValueFromPipeline=$true)]
    [string]$webUrl,
    [Parameter(Mandatory=$true)]
    [string]
$ExcelFileURL,
    [Parameter(Mandatory=$true)]
    [string]
$pageRelativeUrl,
    [Parameter(Mandatory=$true)]
    [string]
$
zone,
     [Parameter(Mandatory=$true)]
    [int]
$
zoneIndex
)     
  
    Start-SPAssignment -Global 

    $spWeb = Get-SPWeb -Identity $webUrl
   
    $newXml = "<?xml version='1.0' encoding='utf-8'?><webParts><webPart xmlns='http://schemas.microsoft.com/WebPart/v3'><metaData><type name='Microsoft.Office.Excel.WebUI.ExcelWebRenderer, Microsoft.Office.Excel.WebUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' /><importErrorMessage>Cannot import this Web Part.</importErrorMessage></metaData><data><properties><property name='Title' type='string'>EWAWP</property><property name='WorkbookUri' type='string'>"+ $ExcelFileURL +"</property></properties></data></webPart></webParts>"
   
    $webpartmanager=$spWeb.GetLimitedWebPartManager($pageRelativeUrl, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
    $errorMsg =""
    $sr = new-object System.IO.StringReader $newXml
    $xr = new-object System.Xml.XmlTextReader $sr
    $myCustomWP = $webpartmanager.ImportWebPart($xr,[ref]$errorMsg)  
        
    if(!$webpartmanager.WebParts.Contains($myCustomWP))
    {
        Write-Host -NoNewLine -f yellow "Adding Webpart - $($myCustomWP.title)"       
        $webpartmanager.AddWebPart($myCustomWP, $zone, $zoneIndex)
        write-host -f Green "...Success!"
    }

    Stop-SPAssignment -Global 


}



Function  Calling -

$webUrl = "http://sever:port"
$ExcelFileURL = "http://sever:port/DocLib1/excel.xslx"
$pageRelativeUrl =  "DocLib1/abc.aspx"
$zone = "Left"
$zoneIndex = 1

Add-EWAWebPart $webUrl  $ExcelFileURL $pageRelativeUrl $zone $zoneIndex


Friday, August 23, 2013

Create Blank WebPart Page Using PowerShell


Use CreateBlankWebpartPage function to create blank webpart page in a Non-Publishing SharePoint web.

Parameters : 
  1. $webUrl - Mandatory - SharePoint Web Url - e.g. http://server:port/ 
  2. $WebPartPageName - Mandatory - New page name
  3. $WebPartPageLibraryName - Mandatory - Parent Library name for new page
  4. $pageLayout - Mandatory - Page Layout code - Int


function CreateBlankWebpartPage

{
    [CmdletBinding()]
    Param(
    [Parameter(Mandatory=$true,ValueFromPipeline=$true)]
    [string]$webUrl,
    [Parameter(Mandatory=$true)]
    [string]
$WebPartPageName,
    [Parameter(Mandatory=$true)]
    [string]
$WebPartPageLibraryName,
    [Parameter(Mandatory=$true)]
    [int]
$pageLayout    )     

   Start-SPAssignment -Global 
    $spWeb = Get-SPWeb -Identity $webUrl   
    $pagesLibrary = $spWeb.Lists | Where { $_.Title -eq $WebPartPageLibraryName }  
    if ($pagesLibrary -eq $null) {
    Write-Host -f red "WebPart Page Library - $WebPartPageLibraryName  Not exists." 
    return  
    }
   
    Write-Host -f yellow "Creating New Webpart page $WebPartPageName in library $WebPartPageLibraryName"
    [Microsoft.SharePoint.SPFile]$spFile = $spWeb.GetFile("/" + $pagesLibrary.RootFolder.Url + "/" + $WebPartPageName + ".aspx")
    $flagConfirm = 'y'
    if($spFile.Exists -eq $true)
    {
        $flagConfirm = Read-Host "Page $WebPartPageName already exists in library $WebPartPageLibraryName, do you want to recreate(y/n)?"
    }
   
    if ($flagConfirm -eq 'y' -or $flagConfirm -eq 'Y')
    {
        Write-Host -NoNewLine -f yellow "Creating New Webpart page $WebPartPageName "

        $cmd ='<?xml version="1.0" encoding="UTF-8"?><Method ID="0,NewWebPage"><SetList Scope="Request">' + $pagesLibrary.ID + '</SetList><SetVar Name="Cmd">NewWebPage</SetVar><SetVar Name="ID">New</SetVar><SetVar Name="Type">WebPartPage</SetVar><SetVar Name="WebPartPageTemplate">' + $pageLayout + '</SetVar><SetVar Name="Overwrite">true</SetVar><SetVar Name="Title">'+ $WebPartPageName +'</SetVar></Method>';

        $spWeb.ProcessBatchData($cmd)
        write-host -f Green "...Success!"
        #Add weppart in Webpart page
   
        foreach($listItem in $pagesLibrary.Items)
        {
            if($($listitem.URL).Contains("$WebPartPageName" + ".aspx"))
            {           
                $myListItem = $listItem
                break;
            }
        }
        $pageUrl =  $($myListItem.URL)
        Write-Host -f yellow "New page Url -  $pageUrl"       
    }
    Stop-SPAssignment -Global 


}

Function  Calling -

$webUrl = "http://sever:port"
$WebPartPageLibraryName = "DocLib1"
$WebPartPageName =  "MyWPPage"
$pageLayout = 1
CreateBlankWebpartPage $webUrl  $WebPartPageName $WebPartPageLibraryName $pageLayout

These are page layouts available for New page.

  1. Full Page, Vertical
  2. Header, Footer, 3 Columns
  3. Header, Left Column, Body
  4. Header, Right Column, Body
  5. Header, Footer, 2 Columns, 4 Rows
  6. Header, Footer, 4 Columns, Top Row
  7. Left Column, Header, Footer, Top Row, 3 Columns
  8. Right Column, Header, Footer, Top Row, 3 Columns
 For more details on NewWebPage method , please check this -
 

Monday, August 19, 2013

Upload File In Document Library Using PowerShell


Use UploadFileInLibrary function to upload a file in SharePoint document Library.

Parameters : 
  1. $webUrl - Mandatory - SharePoint Web Url - e.g. http://server:port/ 
  2. $DocLibName - Mandatory - SharePoint Library Name 
  3. $FilePath - Mandatory - File Path on hard drive , e.g. .\abc.xlsx

function UploadFileInLibrary
{
    [CmdletBinding()]
    Param(
    [Parameter(Mandatory=$true,ValueFromPipeline=$true)]
    [string]$webUrl,
    [Parameter(Mandatory=$true)]
    [string]$
DocLibName,
    [Parameter(Mandatory=$true)]
    [string]$
FilePath
    )
    

  
    Start-SPAssignment -Global 
    $spWeb = Get-SPWeb -Identity $webUrl
    $spWeb.AllowUnsafeUpdates = $true;
    $List = $spWeb.Lists[$DocLibName]
    $folder = $List.RootFolder
    $FileName = $FilePath.Substring($FilePath.LastIndexOf("\")+1)
    $File= Get-ChildItem $FilePath
    [Microsoft.SharePoint.SPFile]$spFile = $spWeb.GetFile("/" + $folder.Url + "/" + $File.Name)
    $flagConfirm = 'y'
    if($spFile.Exists -eq $true)
    {
        $flagConfirm = Read-Host "File $FileName already exists in library $DocLibName, do you    want to upload a new version(y/n)?"
    }
   
    if ($flagConfirm -eq 'y' -or $flagConfirm -eq 'Y')
    {
        $fileStream = ([System.IO.FileInfo] (Get-Item $File.FullName)).OpenRead()
        #Add file
        write-host -NoNewLine -f yellow "Copying file " $File.Name " to " $folder.ServerRelativeUrl "..."
        [Microsoft.SharePoint.SPFile]$spFile = $folder.Files.Add($folder.Url + "/" + $File.Name, [System.IO.Stream]$fileStream, $true)
        write-host -f Green "...Success!"
        #Close file stream
        $fileStream.Close()
        write-host -NoNewLine -f yellow "Update file properties " $spFile.Name "..."
        $spFile.Item["Title"] = "Document Metrics Report"
        $spFile.Item.Update()
        write-host -f Green "...Success!"
    }  
    $spWeb.AllowUnsafeUpdates = $false;



    Stop-SPAssignment -Global  
}


Function  Calling -

$webUrl = "http://sever:port"
$DocLibName = "DocLib1"
$filePath =  ".\text.xlsx"
UploadFileInLibrary $webUrl  $DocLibName $filePath

Friday, August 16, 2013

Create SharePoint List / Library Using PowerShell


Use CreateSharePointLibrary function to create a new SharePoint List or Library.

Parameters : 
  1. $webUrl - Mandatory - SharePoint Web Url - e.g. http://server:port/ 
  2. $LibraryName - Mandatory - SharePoint Library Name 
  3. $Discription - Mandatory - SharePoint Library Description 
  4. $LibraryTemplate - Mandatory - SharePoint Library Template 



function CreateSharePointLibrary
{  
    [CmdletBinding()]
    Param(
    [Parameter(Mandatory=$true,ValueFromPipeline=$true)]
    [string]$webUrl,
    [Parameter(Mandatory=$true)]
    [string]$LibraryName,
    [Parameter(Mandatory=$true)]
    [string]$Discription,
    [Parameter(Mandatory=$false)]
    [string]$LibraryTemplate
    )
   Start-SPAssignment -Global 

   $spWeb = Get-SPWeb -Identity $webUrl    
   $spListCollection = $spWeb.Lists  
   $spLibrary=$spWeb.Lists.TryGetList($LibraryName)
    if($spLibrary -ne $null)
    {
        write-host -f yellow "Library $LibraryName already exists in the site"
    }
    else
    {       
        Write-Host -NoNewLine -f yellow "Creating  Library - $LibraryName"
        $spListCollection.Add($LibraryName, $Discription, $LibraryTemplate)
        $spLibrary = $spWeb.GetList("$LibraryName")
        write-host -f Green "...Success!"
    }         
    Stop-SPAssignment -Global  
}


Function  Calling

$webUrl = "http://sever:port"

#-----------Document Library------------
$DocLibName = "DocLib1"
$LibraryTemplateDL = [Microsoft.SharePoint.SPListTemplateType]::DocumentLibrary
CreateSharePointLibrary $webUrl  $DocLibName  $DocLibName  $LibraryTemplateDL

# -------Data Connection Library-----------
$DataConnLibName = "DataConnLib1"
$LibraryTemplateDCL = [Microsoft.SharePoint.SPListTemplateType]::DataConnectionLibrary
CreateSharePointLibrary $webUrl  $DataConnLibName  $DataConnLibName $LibraryTemplateDCL


Similarly you can create any type of SharePoint List or Libraries , here are the details of List/Library Templates -
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splisttemplatetype.aspx

 

Thursday, August 1, 2013

Configure SSRS in SharePoint 2010

Here are the required steps for configuring SQL Server Reporting Services in SharePoint 2010 integrated mode.

My Test Environment : Single Server For SharePoint And SQL/SSRS Server , e.g. Server Name - GJ-PC

Prerequisites : Make sure you installed Reporting Service feature during SQL Server 2008 R2 Installation. Else add Reporting Services features to your existing SQL installation.
  • SQL/Report Server Configuration : 
    • Open Reporting Services Configuration Manager: Start->All Programs->Microsoft SQL Server 2008 R2 ->Configuration Tools ->Reporting Service Configuration Manager
    • Enter SSRS instance details, Service Account Details and click on Connect.[Required in case if SSRS service instance is not started].
    • Confirm that "Server Status" tab will show the status of SSRS , start the service if it is not started
    • Open "Web Service URL" tab: Configure report server web service virtual directory.Enter the details , e.g.
      • Virtual Directory : ReportServer
      • IP Address: All Assigned (Recommended)
      • TCP Port : 1110
      • Apply setting , 
      • It will create a new web service at http://GJ-PC:1110/ReportServer
    • Open "Database" tab :  
      • Click on change database link
      • Select "Create a new report server database". Click next
      • Enter the details e.g. Server name : GJ-PC , authentication: Current User - Integrated Security
      • Click on Test Connection link. If succeeded then Click next
      • Enter the details e.g. Database Name:Report Server , Report server Mode: SharePoint Integrated Mode
      • Click Next
      • Specify the credentials that the report server will use to connect to the database.You can use Service Credentials.
    • That’s all in SSRS configuration. In next step we will Configure SharePoint to use SSRS.
    •  
  • SharePoint Central Admin Configuration:
    • Open SharePoint 2010 Central Administration Site
    • Click on "General Application Settings", then select "Reporting Services Integration" in "Reporting Services" section.
    • Enter the following details on "Reporting Services Integration" form :
      • Report Server Web Service URL : http://GJ-PC:1110/ReportServer
      • Authentication Mode - Windows Authentication
      • Credential - Domain\User , password
      • Activate the Reporting Services Feature - Activate feature in all existing site collections or Activate feature in specified site collections.E.g. in my case i have activated it only for one site http://GJ-PC:8009
      • Once done, you will see the Activation State message.
    • Open SharePoint 2010 Central Administration -> General Application Settings -> "Add a Report Server to the Integration"
    • Specify the server and instance name of the report server database
  • Verify SSRS and SharePoint Integration
    • Open your SharePoint 2010 site collection
    • Go to Site Settings -> Site Collection Features.
    • Check if the Report Server Integration Feature is Active, if not just click activate.
    • Now upload any sample ssrs report file in SharePoint document library.
    • And open this report. It should show the report data
    •  
  • Create a sample SSRS report to show SharePoint List data into Report and publish it on SharePoint Library-
    • Open SQL Server Business Intelligence Development Studio from:  Start -> "All Programs" -> "Microsoft SQL Server 2008 R2" - SQL Server Business Intelligence Development Studio
    • Create New SSRS Project in Visual Studio : File -> New -> Project...
    • Select “Report Server project” template and create new project.
    • In solution explorer , Right click Reports folder and select Add New Report
    • Click Next to continue
    • Select New data source
      • Name - SPListDataSource
      • Type-Microsoft SharePoint List
      • Connection String - Local SharePoint - http://GJ-PC:8009
      • Credentials - select use Windows Authentication (Integrated Security)
      • Next
    • Click Query Builder
      • Select List - e.g. "MyList"
      • Test Query by "Run Query"
      • Ok -> Next
    • Select Tabular then click Next
    • Drag drop field in detail section , e.g Title, ID
    • Select Style then click Next
    • Enter Report name, Finish
    • Publish Report : 
      • Build Project - Right Click Project name - Build
      • Right Click Project name - Property
      • Set Target Report Folder -  Parent document library for report e.g. http://GJ-PC:8009/SSRS
      • Target Server URL - Site Url e.g. http://GJ-PC:8009/
      • Deploy - Right Click Project name - Deploy
    • Open your document library -  http://GJ-PC:8009/SSRS and check the report.

Monday, December 6, 2010

Forms Based Authentication in SharePoint 2010 - Part 2

<< Forms Based Authentication in SharePoint 2010 - Part 1

Custom Login Form

You Can create a custom login form for your FBA enabled web application in following steps…

  • Locate _forms folder of your webapplication (C:\inetpub\wwwroot\wss\VirtualDirectories\port\_forms)

  • Create a new folder FBA in _forms;

  • Create new page Login.aspx in FBA Folder; add all Resources in this folder e.g. images

  • Open web.config file of FBA enabled web application

  • Change Authentication login page to your custom page ;


    <authentication mode="Forms">
    <!--<forms loginUrl="/_login/default.aspx" />-->
    <forms loginUrl="/_forms/FBA/login.aspx" protection="All" timeout="30" name=".ASPXAUTH" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="default.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false" />
    </authentication>


  • For creating Custom login.aspx , copy existing Default.aspx from _forms root folder to FBA folder , rename it to login.aspx and change html as you wish ; A sample login.aspx can be …

    <asp:Content ID="Content4" ContentPlaceHolderId="PlaceHolderMain" runat="server">

    <div style="text-align:center;margin-top:110px;">
    <asp:login id="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>" runat="server" BorderPadding="4" ForeColor="#333333" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" width="100%" BackColor="#EFF3FB" BorderColor="#B5C7DE" BorderStyle="Solid" >
    <TitleTextStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" Font-Size="0.9em" />
    <InstructionTextStyle Font-Italic="True" ForeColor="Black" />
    <TextBoxStyle Font-Size="0.8em" />
    <LoginButtonStyle BackColor="White" BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284E98" />
    <layouttemplate>
    <asp:label id="FailureText" class="ms-error" runat="server"/>
    <div style="width:350px;border:solid 1px #ECF5FF;padding:3px; background-color:white;">

    <table width="100%" border="0" cellspacing="0" cellpadding="3" style="border:solid 1px #ECF5FF;background-color:#F9FCFF ;background-image:url(/_forms/FBA/Images/lockBG.jpg);background-repeat:no-repeat;">
    <tr>
    <td colspan="2" style="color:#003399;font-size:13px;font-weight:bold;background-color:#F9FCFF;background-image:url(/_forms/FBA/Images/gradiantBlue.jpg); background-repeat:repeat-x; border-bottom:solid 1px #ECF5FF;padding-bottom:8px;">Member Login</td>
    </tr>
    <tr>
    <td align="right" style="padding-top:8px; width: 142px;font-size:12px;" nowrap="nowrap">
    <SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" text="<%$Resources:wss,login_pageUserName%>" EncodeMethod='HtmlEncode'/>
    </td>
    <td style="padding-top:8px; width: 300px;">
    <asp:textbox id="UserName" autocomplete="off" runat="server" class="ms-inputuserfield" width="99%" />
    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
    ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="login">*</asp:RequiredFieldValidator>
    </td>
    </tr>
    <tr>
    <td align="right" style="width: 142px;font-size:12px;" nowrap="nowrap">
    <SharePoint:EncodedLiteral ID="EncodedLiteral2" runat="server" text="<%$Resources:wss,login_pagePassword%>" EncodeMethod='HtmlEncode'/>
    </td>
    <td style="padding-top:8px; width: 300px;">
    <asp:textbox id="password" TextMode="Password" autocomplete="off" runat="server" class="ms-inputuserfield" width="99%" />
    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
    ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="login">*</asp:RequiredFieldValidator>
    </td>
    </tr>
    <tr>
    <td colspan="2" align="right" style="font-size:11px;">
    <asp:button id="login" commandname="Login" text="<%$Resources:wss,login_pagetitle%>" runat="server" Font-Names="Verdana" ForeColor="#284E98" ValidationGroup="login" />
    </td>
    </tr>
    <tr>
    <td colspan="2" >
    <asp:checkbox id="RememberMe" text="<%$SPHtmlEncodedResources:wss,login_pageRememberMe%>" runat="server" />
    </td>
    </tr>
    </table>
    </div>
    </layouttemplate>
    </asp:login>
    </div>

    </asp:Content>







Forms Based Authentication in SharePoint 2010 - Part 1

We can create web applications either using Classic Based Authentication or Claims based Authentication in SharePoint 2010. Classic Mode Authentication refers to the integrated windows authentication. Claims Based Authentication is built on Windows Identity Foundation , we can enable windows as well as form authentication on this mode. Forms based authentication can only be configured with web applications created using Claims Based Authentication. You cannot configure the FBA on Classic Mode Authentication. Using Powershell Script, you can convert your existing Classic mode web application to Claim Based.
In this article, we will see how to configure SQL Server based authentication on SharePoint 2010 site. The Process involve following step of configuration …

  1. Create SqlServer User membership database

  2. Create Sharepoint Web application based on Claim Authentication. OR Convert any exisiting Classic mode web application to Claim based web

  3. Modify Web.Config files for following we applications

    1. Central Administration virtual directory

    2. Security Token Service (STS) virtual directory

    3. New Web application virtual directory


  4. Create Custom Login Form




Setup SqlServer User database

  1. Run aspnet_regsql.exe Located at C:\Windows\Microsoft.NET\Framework\ v2.0.5027 or C:\Windows\Microsoft.NET\Framework64\ v2.0.5027 Directory

  2. ASP.NET SQL Server Setup Wizard Will appears, select “Configure SQL Server for application services”, and then click next

  3. Enter the SQL Server and FBA Database name; E.g. Server = FBADBServer ; Database = FBADB

  4. Complete the Wizard and close;

  5. Make sure the Application Pool accounts (your web application and the Central Administration web site) have access to the FBA database.

  6. Create some test user on this database ; You can use MembershipSeeder tool from codeplex - http://www.codeplex.com/CKS/Release/ProjectReleases.aspx?ReleaseId=7450


Create a new web application

  1. Go to Central Administration -> Application Management -> Manage Web Applications -> Click New

  2. Select Claims Based Authentication

  3. In Claims Based Authentication Type Section ,

    • Check the Enable Windows Authentication Check box

    • Check the Enable Forms Based Authentication(FBA) checkbox

      • In the ASP.NET Membership provider name text box, type AspNetSqlMembershipProvider

      • * In the ASP.NET Role manager name text box, type AspNetSqlRoleProvider







  4. Create a new site collection on this newly created web application.



Convert Web application from Classic Mode to Claims based Authentication

  • On the Start menu, click All Programs -> Microsoft SharePoint 2010 Products -> Click SharePoint 2010 Management Shell

  • From the Windows PowerShell command prompt, type the following:

    $webApp = Get-SPWebApplication “URL”
    $webApp.UseClaimsAuthentication = "True";
    $webApp.Update();
    $webApp.ProvisionGlobally();

  • This script will convert your Classic mode web application into Claim Based; Now you can enable Form authentication on this web application -

  • Go to your web app’s authentication provider settings -> Click on Default Zone -> select your identity provider for FBA





Modify Central Administration site’s web.config File

  • "ConnectionStrings" Entry


    <configSections>…</configSections>
    <connectionStrings>
    <clear />
    <add name="AspNetSqlMembershipProvider" connectionString="data source=FBADBSERVER;Integrated Security=SSPI;Initial Catalog=FBADB" providerName="System.Data.SqlClient" />
    </connectionStrings>



  • "PeoplePickerWildcards" Entry


    <SafeControls>…</SafeControls>
    <PeoplePickerWildcards>
    <clear />
    <add key="AspNetSqlMembershipProvider" value="%" />
    <add key="AspNetWindowsTokenRoleProvider" value="%"/>
    </PeoplePickerWildcards>




  • "RoleManager & Membership" Entries


    <system.web>
    <roleManager enabled="true"
    cacheRolesInCookie="false"
    cookieName=".ASPXROLES"
    cookieTimeout="30"
    cookiePath="/"
    cookieRequireSSL="false"
    cookieSlidingExpiration="true"
    cookieProtection="All"
    defaultProvider="AspNetWindowsTokenRoleProvider"
    createPersistentCookie="false"
    maxCachedResults="25">
    <providers>
    <clear />
    <add connectionStringName="AspNetSqlMembershipProvider"
    applicationName="/"
    name="AspNetSqlRoleProvider"
    type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add applicationName="/"
    name="AspNetWindowsTokenRoleProvider"
    type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
    </roleManager>

    <membership defaultProvider="AspNetSqlMemberShipProvider"
    userIsOnlineTimeWindow="15" hashAlgorithmType="">
    <providers>
    <clear />
    <add connectionStringName="AspNetSqlMembershipProvider"
    enablePasswordRetrieval="false"
    enablePasswordReset="true"
    requiresQuestionAndAnswer="true"
    passwordAttemptWindow="10"
    applicationName="/"
    requiresUniqueEmail="false"
    passwordFormat="Hashed"
    name="AspNetSqlMemberShipProvider"
    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
    </membership>


    </system.web>





Modify Security Token Service (STS) Site’s web.config
(Located at - %programfiles%\common files\Microsoft Shared\web server extensions\14\WebServices\SecurityToken\web.config)

  • Add Following code for connectionStrings , roleManager & membership Entries. Add just before

    <configuration>

    <system.net>

    </system.net>
    <connectionStrings>
    <clear />
    <add name="AspNetSqlMembershipProvider" connectionString="data source=FBADBSERVER;Integrated Security=SSPI;Initial Catalog=FBADB" providerName="System.Data.SqlClient" />
    </connectionStrings>
    <system.web>
    <membership>
    <providers>
    <add connectionStringName="AspNetSqlMembershipProvider"
    enablePasswordRetrieval="false"
    enablePasswordReset="true"
    requiresQuestionAndAnswer="true"
    passwordAttemptWindow="10"
    applicationName="/"
    requiresUniqueEmail="false"
    passwordFormat="Hashed"
    name="AspNetSqlMemberShipProvider"
    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
    </membership>

    <roleManager enabled="true">
    <providers>
    <add connectionStringName="AspNetSqlMembershipProvider" applicationName="/"
    name="AspNetSqlRoleProvider"
    type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
    </roleManager>
    </system.web>

    </configuration>




Modify claims based web application’s web.config file

  • "ConnectionStrings" Entry

    </configSections>
    <connectionStrings>
    <clear />
    <add name="AspNetSqlMembershipProvider" connectionString="data source=FBADBSERVER;Integrated Security=SSPI;Initial Catalog=FBADB" providerName="System.Data.SqlClient" />
    </connectionStrings>


  • "PeoplePickerWildcards" Entry

    </SafeControls>
    <PeoplePickerWildcards>
    <clear />
    <add key="AspNetSqlMembershipProvider" value="%" />
    <add key="AspNetWindowsTokenRoleProvider" value="%"/>
    </PeoplePickerWildcards>



  • "RoleManager & Membership" Entries


    <membership defaultProvider="i" userIsOnlineTimeWindow="15" hashAlgorithmType="">
    <providers>
    <clear />
    <add connectionStringName="AspNetSqlMemberShipProvider"
    enablePasswordRetrieval="false"
    enablePasswordReset="true"
    requiresQuestionAndAnswer="true"
    passwordAttemptWindow="10"
    applicationName="/"
    requiresUniqueEmail="false"
    passwordFormat="Hashed"
    name="AspNetSqlMemberShipProvider"
    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add name="i"
    type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
    </providers>
    </membership>
    <roleManager enabled="true"
    cacheRolesInCookie="false"
    cookieName=".ASPXROLES"
    cookieTimeout="30"
    cookiePath="/"
    cookieRequireSSL="false"
    cookieSlidingExpiration="true"
    cookieProtection="All"
    defaultProvider="c"
    createPersistentCookie="false"
    maxCachedResults="25">
    <providers>
    <clear />
    <add connectionStringName="AspNetSqlMemberShipProvider"
    applicationName="/"
    name="AspNetSqlRoleProvider"
    type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add applicationName="/"
    name="AspNetWindowsTokenRoleProvider"
    type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
    </providers>
    </roleManager>

    </system.web>





Save all the web.config files and do an IISRESET ;
Now open your web site in new browser , Below login form will open which will allow You to select authentication type while login



Custom Login Form

Forms Based Authentication in SharePoint 2010 - Part 2 >>

Monday, February 22, 2010

Sharepoint 2010 Installation & Configuration - Part 4

<<Sharepoint 2010 Installation & Configuration - Part3
<<Sharepoint 2010 Installation & Configuration - Part2
<<Sharepoint 2010 Installation & Configuration - Part1

  1. Office Web Application

    • Install “Office Web Applications”
      • Enter your Product Key (BQDC3-93DMP-HGJB2-MFFV8-622QJ)
      • Click “I accept the terms…”
      • Click “Continue”
      • Click “Install Now”
      • When Setup finishes, a dialog box prompts you to complete the configuration of your server.
        • Run the Configuration Wizard only if the SharePoint Post-Setup Configuration Wizard (PSConfig) has not been run with the original SharePoint installation.
          • Select the check box, and then click Close to start PSConfig.
          • Click “Next”
          • Click “Yes”
          • Click “Next”
          • Click “Next”
          • Click “Finish”
      • Note :
        • Activate the Office Web Apps services immediately after you run setup. When you run Wcsetup.exe, Office Web Apps setup takes control of the Default open behavior for browser enabled documents setting for all document libraries. If a user clicks on a document in a library in SharePoint Foundation after Office Web Apps setup has been run, but before Office Web Apps services have been activated, the user can get a broken link when opening a document in a browser. We strongly recommend that you activate the Office Web Apps services and the Office Web Apps feature immediately after you run setup or that you disable the Default open option until Office Web Apps feature and services have been activated.
        • You must install Office Web Apps by running WCSetup.exe on every server that will host Office Web Apps in the server farm.
    • Activate Office Web APPs
      • if you have never run the Farm Configuration Wizard prior to installing Office Web Apps, running the Configuration Wizard with Office Web Apps installation will automatically activate the required service instances, service applications, and service application proxies.
      • If you have run configuration wizard but haven’t crated any web application then you can run the Farm Configuration Wizard again to activate owa.Alternatively(if you have already ran Farm configuration and don’t want to re run it) you can do it manually
        • Open Central Administration
        • Click “Application management”
        • Click “Manage service applications”
        • Click “New->PowerPoint Service Application”
        • For name, type “PowerPoint Service”
        • For pool name, type “PPTPool”
        • Click “OK”
        • Click New->Word Viewing Service”
        • For name, type “Word Viewing Service”
        • For application pool type “WordViewingPool”
        • Click “OK”
        • On the service applications page, click “PowerPoint Service Application”
        • Click “new site collection”
        • For title, type “PPT Broadcast”
        • For the url, in the dropdown select “sites”
        • For the url textbox, type “PPTBroadcast”
        • For template, click “Enterprise”, select “PowerPoint Broadcast Site”
        • For site collection admin, type “administrator”
        • Click “OK”
        • Click “System Settings”
        • Click “Manage services on server”
        • Click “Start” for:
          • PowerPoint Service
          • Word Viewing Service
      • Else you can manually activate the appropriate service instances, service applications, and proxies using powershell. Manually performing these steps by using Windows PowerShell is required only if you installed SharePoint and ran PSConfig on a stand-alone server before you installed Office Web Apps.Activation Steps:
        • To run scripts in Windows PowerShell, you must set the execution policy to run scripts unrestricted.
          • Click Start, point to All Programs, point to Windows PowerShell, right-click Windows PowerShell, and then click Run as administrator.
          • In the Windows PowerShell console, at the command prompt, type set-executionpolicy unrestricted, and then press ENTER.
        • A service instance provides the physical location for a service application. For each server you want to run the Office Web Apps service applications; you must start the service instances. Start the service instances by running the following script in Windows PowerShell:
          $machinesToActivate = @(“contosoapp1”,”contosoapp2”)
          $serviceInstanceNames = @(“Word Viewing Service”, “PowerPoint Service”,
          “Excel Calculation Services”)
          foreach ($machine in $machinesToActivate) {
          foreach ($serviceInstance in $serviceInstanceNames){
          $serviceID = $(Get-SPServiceInstance | where
          {$_.TypeName -match $serviceInstance} | where
          {$_.Server -match "SPServer Name="+$machine}).ID
          Start-SPServiceInstance -Identity $serviceID
          }
          }
        • After the service instances have been started, the service applications and the service application proxies which connect the Web front-ends to the service applications must be created. Create the service applications and the service application proxies by running the following script:
          $appPool = Get-SPIisWebServiceApplicationPool
          –Name “SharePoint Web Services Default”
          New-SPWordViewingServiceApplication –Name “WdView” –AppPool $appPool |
          New-SPWordViewingServiceApplicationProxy –Name “WdProxy”
          New-SPPowerPointServiceApplication –Name “PPT” –AppPool $appPool |
          New-SPPowerPointServiceApplicationProxy –Name “PPTProxy”
          New-SPExcelServiceApplication –Name “Excel”
          -SPIisWebApplicationPool $appPool |
        • Office Web Apps require that the Office Web Apps feature be activated on every site collection for which the Web apps will be available. Activate the Office Web Apps feature for all site collections by running the following script:
          $webAppsFeatureId = $(Get-SPFeature -limit all | where {$_.displayname
          -eq "OfficeWebApps"}).Id
          Get-SPSite –limit ALL |foreach{
          Enable-SPFeature $webAppsFeatureId –url $_.URL }
        • After activating Office Web Apps, the Default click feature in SharePoint Foundation will point to the Office Web Apps instead of the Office client application. You can override this functionality in SharePoint Foundation at the site collection and document library levels.
          • Site collection - This example disables the Default click setting at all site collections:
            $webAppsFeatureId = $(Get-SPFeature -limit all | where {$_.displayname
            -eq "OpenInClient"}).Id
            Get-SPSite –limit ALL |foreach{
            Enable-SPFeature $webAppsFeatureId –url $_.URL }
          • Document library - This example disables the Default click setting at all document libraries in site1:
            Get-SPWeb –site http://foo/sites/site1 |% {}{$_.Lists}{$_.Update()} |% {$_.DefaultItemOp>en = $false}
    • If you are trying to use Office Web Applications on DC(Office Web Application need to be installed seperately, like a language pack or an update. Please also note that Office Web Application needs to follow the edit of config.xml to install on Windows 7), then the following commands need to be run to make the services work. Please note that in different languages, Service Application names could be localized. You can find them out by Get-SPServiceApplications, and then change the names in the script as necessary.
      • $e = Get-SPServiceApplication | where {$_.TypeName.Equals("Word Viewing Service Application")}
        $e.WordServerIsSandboxed = $false
        $e.WordServerIsSandboxed
      • #(Please use the below script for PowerPointServiceApplication - You need to enter "Y" for the answer of each cmd)
        Get-SPPowerPointServiceApplication | Set-SPPowerPointServiceApplication -EnableSandboxedViewing $false
        Get-SPPowerPointServiceApplication | Set-SPPowerPointServiceApplication -EnableSandboxedEditing $false
      • In the server's c:\windows\system32\inetsrv\config\applicationHost.config
        Add the line below in the end of the dynamicTypes.

      • IISRESET
  2. Enable Developer Dashboard and turn to OnDemand for troubleshooting page performance issues. It can be done by STSADM or SharePoint 2010 Management Shell (Windows PowerShell).
    •  STSADM: stsadm -o setproperty -pn developer-dashboard -pv OnDemand
    •  Windows PowerShell:
      $svc=[Microsoft.SharePoint.Administration.SPWebService]::ContentService
      $ddsetting=$svc.DeveloperDashboardSettings
      $ddsetting.DisplayLevel=[Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand
      $ddsetting.Update()
  3. Enable Sandboxed Solutions - If you are using SharePoint on Domain Controller, the following Windows PowerShell command would need to be run to enable Sandboxed Solutions.
    $acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName
    $person = [System.Security.Principal.NTAccount]"Users"
    $access = [System.Security.AccessControl.RegistryRights]::FullControl
    $inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit"
    $propagation = [System.Security.AccessControl.PropagationFlags]::None
    $type = [System.Security.AccessControl.AccessControlType]::Allow
    $rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type)
    $acl.AddAccessRule($rule)
    Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl

Sharepoint 2010 Installation & Configuration - Part5 >> coming soon

Sharepoint 2010 Installation & Configuration - Part3

<<Sharepoint 2010 Installation & Configuration - Part2
<<Sharepoint 2010 Installation & Configuration - Part1

  1. Run SharePoint Configuration Wizard - Run the configuration wizard and create the new farm, configuration database and central administration website
    • Click “Start->All Programs->Microsoft SharePoint 2010 products->SharePoint 2010 Products Configuration Wizard”
    • Click “Next”
    • In the popup, click “Yes”
    • Select “Create a new server farm”
    • Click “Next”
    • For database server, type “SPSServer”
    • For username, type “XYZ\SPSAdmin”
    • For password, type “Pass@123”
    • Click “Next”
    • For passphrase, type “Pass@123”
    • Click “Next”
    • Click “Next”,
    • Click “Next”, SharePoint 2010 will Configure itself
    • Click the radio button to participate in the feedback program, we gotta make SharePoint better right?!?
    • Click “Walk me through the settings using this Wizard” radio button
    • Click “Next”
    • Click “Use existing managed account” . Select XYZ\spsadmin for the Service Account
    • Click “Next”, all your services will be created, this will take a few minutes
    • Click “Skip”
    • Click “Finish”
  2. Central Admin Site
    • Add a farm administrator
      • Click “Security”
      • Click “manage farm administrators group”
      • Click “New->Add Users”
      • Add Farm Admin Users e.g. XYZ\SPSadmin
      • Click “Ok”
    • Setup Diagnostic Logging
      • Click “Monitoring”
      • Under “Reporting”, click “Configure usage and health data collection”
      • Ensure that “Enable usage data collection” is clicked
      • Ensure that “Enable health data collection” is clicked
      • Click “Ok”
    • Setup Outgoing Email
      • Click “System Settings”
      • Click “Configure out-going email Settings”
      • For outbound smtp, type “SPSServer”
      • For from address, type “sharepoint@XYZ.com”
      • For reply address, type sharepoint@ XYZ.com
      • Click “Ok”
    • Start services on a server
      • Ensure that the “SharePoint Web Service” application pool in IIS is started
      • Click “System Settings”
      • Click “Manage services on server”
      • Start all services, except for “Lotus Notes Connector”
        • Install “Document Conversions Load balancer” before you start the launcher service, select “servername” when setting up the launcher service.
        • For SharePoint Foundation Search , use the following settings:
          • For Username type, “XYZ\Administrator”
          • For password, type “Pass@123
          • For content access account type “XYZ\Administrator”
          • For password, type “Pass@123”
          • Click “Start”
        • For “User Profile Synchronization Service
          • Click “Start”
          • Select the only “User Profile Service Application”
          • Click “OK”
          • Wait for the status of the job to change to “Started”

  3. Configure the User Profile
    • Ensure Windows Services have started (Start -> Administrative Tool -> Services)
      • Open the Services Applet
      • Ensure these two service eventually start
          ForeFront Identity Manager Service o ForeFront Identity manager Synchronization Service
    • Reset IIS – IISRESET
    • Configure the User Profile service
      • Click on "Application Management" then click on "Manage service applications"
      • Scroll down and click on "User Profile Service Application"
      • Click on "Configure Synchronization Connections" - NOTE: you may see the below error, if you do simply do an IISRESET - An error has occurred while accessing the SQL Server database or the SharePoint Server Search service. If this is the first time you have seen this message, try again later. If this problem persists, contact your administrator.
      • Click “Create new connection”
      • Fill in details - connection name, forest name, account name, password
      • Click “Populate Containers” - NOTE: if you get an error, change the browser settings to IE7.0
      • Expand “XYZ”
      • Select “Users” OU Tree node - NOTE: Clicking "Select All" does not work in this build!
      • Click “Ok”
      • You should now see a connection in this list. - NOTE: if you get to next screen and nothing shows, please ensure both Forefront Windows Services are started.
      • Go back to "User Profile Service Application" page from "Manage Service Applications"
      • Click "Start Profile Synchronization"
      • Select "Start Full Synchronization" then click "OK". - NOTE: this will take a few minutes as a job is scheduled to do this.
      • If you get this error:"Cannot navigate to the requested page while User Profile Synchronization is running. Please wait for the current Sychronization run to finish." . You will need to restart the machine (you can most likely just restart the services too)


Sharepoint 2010 Installation & Configuration - Part4 >>

Tuesday, February 16, 2010

Sharepoint 2010 Installation & Configuration - Part2

SharePoint 2010 Installation

  • Environment
    Here are the machine names and network settings used; please substitute your own as needed.
    • Domain Controller
      • Hostname: DC
      • IP : 192.168.100.100
      • Operating System: Windows Server 2008 R2
      • Server Role(s): Active Directory Domain Services, DNS
      • Forest Root Domain: XYZ.com
    • Member Server
      • Hostname: SPSServer
      • IP : 192.168.100.1
      • Operating System: Windows Server 2008 R2 + WCF hotfix
      • Server Software: SQL Server 2008 SP1 + CU
    • User accounts
      • Server administrator - XYZ\Administrator , Password - Pass@123
      • Sharepoint administrator - XYZ\SPSAdmin , Password - Pass@123
  • SharePoint 2010 - Step by Step Install
    1. Install OS - Install Windows Server 2008 R2
    2. Server Manager Setting
      • Open Server Manager
      • Set IE Security – Temporarily turn off the IE hardening (Internet Explorer Enhanced Security) - Under Security Information – Click on Configure IE ESC - turn Off for both administrators and users
      • Windows Firewall properties - Go to Windows Firewall - Windows Firewall properties - For domain, private, public, set the firewall status to “Off”
    3. Run Windows Update(Start->All Programs->Windows Update) install latest windows update software & Restart.
    4. Install Microsoft Windows Server 2008 SP2 , in case u r using 2008 not r2 & optionally do step 3
    5. Login to SPSServer.XYZ.com as XYZ\spsadmin to install software.
    6. Install SQL Server
      • SQL Server 2008
        • Microsoft SQL Server 2008 SP1
        • CU package 2 - This cumulative update consists of two parts; ensure that you download both files. When you install Microsoft SQL Server 2008 SP1 on Windows Server 2008 R2, you might receive a compatibility warning. You can disregard this warning and continue with your installation
      • Check the following:
        • Database Engine
        • SQL Server Replication
        • Full-Text Search
        • Analysis Services
        • Reporting Services
        • Business Intelligence Development Studio
        • Client Tools Connectivity
        • Integration Services
        • Client Tools Backward Compatibility
        • Management Tools – Basic
        • Management Tools - Complete
        • Microsoft Sync Framework
      • On report Services, click “Install, but do not configure…” radio button
      • Use For all accounts, type “XYZ\SPSAdmin” and “Pass@123” for password
      • Click “Mixed Mode” authentication radio button
      • Click “Add Current User”
    7. do step 3
    8. install WCF hotfix patch for 2008 R2
    9. do step 3
    10. Install Office 2010 Professional Plus Beta & setup the initial settings
    11. Install Visio 2010
    12. Install Microsoft SharePoint Designer 2010
    13. Install Visual Studio 2010
    14. Optionally Install latest version of browser (FireFox/ Google Chrome/ Apple Safari)
    15. Install Enterprise Library 4.1
    16. Check Internet connection on server
    17. Install “SharePoint 2010” prerequisites.
      • Run sharepoint setup & click on Install Prerequisites” – (this step will require internet access)
      • Click “Next”
      • Accept terms and click Next.
        • All pre-reqs will be downloaded and installed, including application server role
        • on Server 2008 it will also install SP2 ,if it does, a reboot will be required.
    18. Perform a reboot after installing all the pre-requisites
    19. Install “SharePoint 2010” product
      • Click “Install SharePoint Server”
      • Enter your trial product key - You can use these product keys (Enterprise Version though):
        • PKXTJ-DCM9D-6MM3V-G86P8-MJ8CY
        • BV7VC-RMR6B-26P6Y-BTQDG-DX2KQ
      • Click “Continue”
      • Click “I accept…”
      • Click “Server Farm”
      • Select “Complete…”
      • Click “Install Now”
      • Click “Close” (uncheck the run configuration wizard)
    20. Ensure proper permissions are setup (these steps will fix the CryptographicException error): Right click on the folder ('%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14), select “Properties” - “Security” tab-give Full Control to “Network Service”


<<Sharepoint 2010 Installation & Configuration - Part1

Sharepoint 2010 Installation & Configuration - Part3 >>

----------------

Thursday, February 11, 2010

Sharepoint 2010 Installation & Configuration - Part1

Hardware and Software Requirements for Sharepoint 2010

-------------
Sharepoint 2010 Installation & Configuration - Part2 >>


-----------
Resources

Tuesday, January 26, 2010

Sharepoint 2010 VHD Download

http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2&displaylang=en

This download contains a two Virtual Machine set for evaluating and demonstrating Office 2010 and SharePoint 2010.
Virtual machine “a” contains the following pre-configured software:
  1. Windows Server 2008 SP2 Standard Edition x64, running as an Active Directory Domain Controller for the “CONTOSO.COM” domain with DNS and WINS
  2. Microsoft SQL Server 2008 SP2 Enterprise Edition with Analysis, Notification, and Reporting Services
  3. Microsoft Office Communication Server 2007 R2
  4. Visual Studio 2010 Beta 2 Ultimate Edition
  5. Microsoft SharePoint Server 2010 Enterprise Edition Beta 2
  6. Microsoft Office Web Applications Beta 2
  7. FAST Search for SharePoint 2010 Beta 2
  8. Microsoft Project Server 2010 Beta 2
  9. Microsoft Office 2010 Beta 2
  10. Microsoft Office Communicator 2007 R2

Virtual machine “b” contains the following pre-configured software:
  1. Windows Server 2008 R2 Standard Evaluation Edition x64, joined to the “CONTOSO.COM” domain
  2. Microsoft Exchange Server 2010 Active directory has been preconfigured over 200 “demo” users with metadata in an organizational structure. SharePoint Server 2010 has been configured in a “Complete” farm using Kerberos authentication and the default SQL Server 2008 instance for data, and has a site collection created using the Team Site template at http://intranet.contoso.com/ and a FAST Search Center at http://intranet.contoso.com/search/.


http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2&displaylang=en

Tuesday, December 22, 2009

Sharepoint 2010 Top 10 : Development

  1. Client Object Model
    • SharePoint 2010 introduces three new client APIs for interacting with SharePoint sites: from a .NET managed application, from a Silverlight application, or from ECMAScript (JavaScript, JScript) that executes in the browser. These new APIs provide access to a subset of the types and members that are contained in the Microsoft.SharePoint namespace of the server-side object model.
    • The new client object models provide an object-oriented system for interoperating with SharePoint data from a remote computer, and they are easier to use than the already existing SharePoint Web services. You start by retrieving a client context object that represents the current request context, and through this context, you can obtain access to client objects at site-collection level or lower in the SharePoint hierarchy. Client objects inherit from the ClientObject class (ECMAScript: ClientObject), and you can use them to retrieve properties for a specific SharePoint object, to retrieve child objects and their properties, or to retrieve child items from a collection.
    • Examples - SP.ClientContext, SP.Site, SP.Web, SP.ListItem, SP.Field, SP.WebParts.
  2. Mobile Device Development Enhancements
    • Greatly expands access from mobile devices to SharePoint pages, lists, and functionality.
    • Mobile Web Part Adapters - It is now possible to have a mobile page that corresponds to a nonmobile Web Parts page. You can adapt any Web Part on a nonmobile page by adding a control (mobile adapters) to the mobile page that duplicates the Web Part’s functionality. Some built in Web Parts already have adapters. You can develop your own adapters. A mobile adapter must be registered in the compat.browser file and registered as a Safe Control. For each Web Part on the Web Part page that has an adapter control, the adapter control will be rendered on the mobile page.
    • Mobile Messaging - SharePoint can now incorporate Short Messaging Service (SMS) messages sent to mobile telephones. A rich set of classes has been added to the object model to represent the Web Methods and response types of this protocol. If your solution requires a different protocol (other than OMS), base classes have been provided with default implementations of essential properties and methods.
    • ALERT - SharePoint 2010 takes advantage of the new mobile messaging framework to enhance its Alerts feature, to enable users to have alerts sent as SMS messages to their mobile devices. The SPAlert class now has a property that indicates whether the alert is delivered as e-mail or as an SMS message.
    • New Mobile Pages and Controls - SharePoint 2010 adds many new types of mobile pages and over 60 new public mobile controls for view filtering, people selection, file uploading, images, wiki pages, Web Parts pages, and other functionality.
  3. Sandboxed Solution
    • A sandboxed solution allows site collection users to upload their own custom code solutions. A sandboxed solution uses a subset of the Microsoft.SharePoint namespace. These objects are marked in the object model to show their availability in a sandboxed solution. All sandboxed solutions are stored in a solution gallery(under the _catalogs). In addition, there are facilities provided to help server farm administrators monitor and validate solutions that have been uploaded to these galleries. Performance can be monitored by measuring CPU execution time, memory consumption, and database query time. You can also monitor other aspects of operation including abnormal termination, critical exceptions, unhandled exceptions, and data marshaling size.
    • Now solutions built from the SharePoint Designer and Visual Studio are all .WSP.
    • Enables you to run user solutions without affecting the rest of the SharePoint farm. Users can upload their own custom solutions without requiring intervention from administrators, and without putting the rest of the farm at risk.
    • Runs in a separate process. Sandboxed solutions are restricted by CAS and the API subset
    • Sandboxed solutions are managed in Central Administration. Fully supported tooling in VS 2010
    • You can switch your project back and forth between PTS and Full Trust.
    • Supported elements -
      Content Type, Site Columns,Custom Actions, Declarative Workflow,Event receivers, feature receivers,InfoPath Form Services etc.
  4. Visual Studio 2010 SharePoint tools
    • Lot of great features and project templates for SharePoint developers. With all new SharePoint project templates you can leverage new configurable deployment feature which lets you configure the way you want to deploy or retract your project. You can use SharePoint extensibility to create your own, custom deployment steps and deployment configurations. Some SharePoint projects can be deployed either as sandboxed or farm solutions.
    • You can create extensions for projects, project items, define your own project item types and create deployment extensions.
    • Feature and package designers give you the ability to customize features in your solution and with packaging designer you can customize which features are getting deployed and how.
    • SharePoint Explorer is a new tool window that gives you a view into your SharePoint server. You can get a hierarchical view of lists, sites and workflows on your SharePoint server.
    • The following SharePoint specific project templates and project item templates are available in Visual Studio 2010:
      • Project Templates - Empty SharePoint project, Visual Web Part project, Sequential and State Machine Workflow,Business Data Connectivity Model, Event Receiver,List Definition,Content Type,Module Project,Site Definition
      • Project Item Templates - Empty Element,Web Part ,User Control,Application Page,Association Form,Initiation Form,
        Business Data Connectivity Resource Item,List Instance,List Definition From Content Type,Global Resources File
      • Besides above mentioned project templates, there are two import project templates for importing : Import Reusable Workflow,Import SharePoint Solution Package
    • VS 2010 have a very good integration support with SP2010 and we can easily build Sharepoint Artifacts and debug artifacts like web-parts just by hitting (CTRL-F5). For building custom web-parts, list definitions, etc out of the box i.e. no need to install a separate set of templates as we used to do it in MOSS 2007. The UI is cool which also gives us an option to preview the web-parts. you *can’t* use VS 2010 and SPD 2010 with MOSS 2007 or WSS 3.0, no backward compatibility. Just an exception to this fact is workflow projects of MOSS 2007, you can use it with VS 2010.
  5. Developer Dashboard
    • This feature displays us the diagnostic and performance related statistics. Something like how long did the request take to run, what event handlers were fired, in what sequence did these event handlers fire.
    • The developer dashboard in SharePoint gives developers the ability to monitor how well their code base is performing – on a page by page basis. For instance – when enabled, at the bottom of every page you'll see a report of all the custom code that has ran on that page, as well as how long it took to run. This dashboard helps you know how well each performs, which can help you identify if one is becoming a bottle neck for your whole page.
    • This is a tool that will give you
      • A breakdown of the request/response cycle with timings for each operation.
      • A breakdown of the response times for each database query that the rendering process triggers.
      • A breakdown of the load times for each Web Part on the page.
    • There are two methods to initialize this tool to work on your sites. You can do this with your handy old stsadm.exe or with PowerShell.
      • stsadm –o setproperty –pn developer-dashboard –pv OnDemand
      • (Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = "OnDemand" .
    • The results will show you a little icon on the top right corner of your page. Clicking on the icon circled with either display or hide the results.
  6. Event Enhancements - new event model capabilities include the following:
    • on-create events for lists and Web sites.
    • Many of the new events are available in both synchronous and asynchronous modes.
    • add and delete events on lists.
    • add events on Web sites.
    • after events can now be either synchronous or asynchronous.
    • Event registration at the site collection level.
    • XML event registration at the site receiver.
    • Improved semantics for retrieving event data.
    • Improved user interface for form-level events.
    • Web-Adding: this event fires when a new Web site is created. If cancelled, then no Web site is created and the provisioning process does not begin.
    • WebProvisioned : This event fires after the Web site is fully provisioned and the provisioning process has stopped. It can be either synchronous or asynchronous.
  7. Query Enhancements (LINQ ,CAML)
    • New Query Support for Server Side Code - Querying data in server code has become significantly easier and more powerful in SharePoint 2010.
    • List Joins Supported in CAML Queries - You can now join multiple lists in a single query with the new Join Element (View). Use the new ProjectedFields Element (View) to specify what list fields to include in the results.
    • Querying in Client Side Code (Client Object Model) - You can query within the client object model in two ways: CAML queries or LINQ query.
    • Support for ADO.NET Data Services Framework - If your client application does not use the new SharePoint client object model and you only need to query list data, you have the option of querying the content databases by using ADO.NET Data Services Framework.
    • LINQ to SharePoint
      • SharePoint 2010 includes a LINQ to SharePoint provider to enable your code to query SharePoint lists from server code by using LINQ syntax. The provider translates your LINQ queries into CAML queries for submission to the content database.
      • you can have both implicit and explicit joins in your LINQ queries by using the join keyword.
      • You can also write to the lists by using the provider. As always with a LINQ provider, you must have classes that provide an object-oriented interface over the relational content databases. These classes are generated for you by the SPMetal tool that is included with SharePoint 2010.
      • SPMetal is a command line tool that generates entity classes, which provide an object oriented interface to the Microsoft SharePoint content databases. These classes are primarily used in LINQ to SharePoint queries; but they are also be used to add, delete, and change list items with protection against concurrency conflicts. Finally, they can be used as an alternative to the regular SharePoint object model for referencing content.
      • You can use LINQ syntax in your code even if you are not using the LINQ to SharePoint provider. Any SharePoint object that implements IEnumerable<(Of <(T>)>) can be queried with LINQ syntax.
      • The Microsoft.SharePoint.Linq namespace will contain the LINQ to SharePoint provider.
  8. Workflow Improvements
    • New Workflow Activities - New workflow actions (activities) are built into the core installation of SharePoint Foundation. New activities give you greater flexibility in your workflow design.
    • Pluggable Workflow Services - Pluggable workflow services allow you to create workflows that interact and receive data from external sources.
    • Workflow Events - Workflows in WSS3.0 were built to respond to a limited number of events. In SharePoint Foundation, workflows can interact with even more events. SharePoint Foundation also gives you the ability to create your own custom events and event receivers.
    • Site Workflows - Site workflows now allow you to develop workflows that can be associated with specified events and other workflow activities.
    • High Privilege Workflows - High Privilege Workflows allow declarative workflows to be executed with privileges other than the privileges of the workflow initiator.
    • Reusable Declarative Workflows - In SharePoint Foundation, declarative workflows are reusable, which allows you to apply your workflow development efforts for one list to multiple places.
    • It is now possible in SP2010 to have workflows scoped at Site level.In MOSS2007 it was only possible to apply workflow to List level.
    • SharePoint 2010 now supports workflows that can run without a SharePoint list item.
    • SharePoint Designer 2010 has a new designer for building workflows and these workflows can be exported directly to Visual Studio 2010. Visual Studio 2010 also has workflow tools improvements with a new workflow form designer, support for Sandboxed Solution workflow activities and the new Visual Studio 2010 SharePoint tools packaging designer.
    • Workflows used to be at Web Application Level in 2007. Now, you can build workflow at the site-level.
  9. Timer Jobs
    • Timer Job Overhauled. You can assign a timer job to any number of server in the farm.
    • From Central Admin you can run the timer job at will (Option: Run Now).
    • Detailed report on the job status, history as well as Progress bar showing the jobs which are running.
    • New Timer Jobs – new 21 jobs been added. we have 60 Jobs for SharePoint 2010
    • Timer Links - menu allows you to manage all jobs from the single screen, so you don’t need to navigate back to the Central Administration to switch on another screen.
    • You can see the jobs grouped by status – Scheduled, Running and History, instead of just a list of all jobs.
    • Ability to edit the job property from the status screen – all jobs are hyperlinks.
    • The change of edit time jobs are in the ability to change the time when the job starts via UI (previously you should do this via STSADN) and run job immediately
    • you can use the following PowerShell cmdlets(STSADM is still supported) to manage your Timer Jobs:Disable-SPTimerJob ,Enable-SPTimerJob
      Get-SPTimerJob ,Set-SPTimerJob ,Start-SPTimerJob
  10. Others
    • WCF - many of SharePoint’s own web services are now WCF services, but also because if you ever want to build a service application in SharePoint 2010, you’ll need to do WCF work.
    • Development on Windows 7 - SP 2010 development now on Windows-7 & vista(sp1 64-bit)
    • Upgrade and Packaging - SharePoint 2010 provides a more availability during upgrades and patching.
      • There is better support for read-only databases which allows users to access content while you upgrade or patch that content in another location.
      • SharePoint supports simultaneous database attach via Powershell which may reduce downtime associated with patching by multithreading the upgrade process.
      • There is also an option to redirect users to a 2007 farm on a per AAM basis which could reduce perceived downtime on large farms with multiple web applications since the entire farm doesn’t have to “appear” to be undergoing upgrade.
      • There is an option during patching to schedule the disruptive portion of the patch (the database upgrade part) so that downtime can be scheduled for a better time.


More - SharePoint 2010 Top 10 Features

Source - SharePoint 2010 Resources