Monday, November 4, 2013

Powershell script to go through all lists in a website and update the field value if a field exists

##Go through all lists in a website and update the field value if a field exists

 $web = get-spweb http://webSite/ITSprojects/ERP/

 foreach ($list in $web.lists)
 {
if( $list.Fields.ContainsField("Required for Round 6") -eq $true)
    {                                      
        Write-Host "Required for Round 6 found and updating value in " $list.title
$listItms = $list.Items
foreach ($item in $listItms)
{
$item["Required for Round 6"]="0";
$item.Update();
}
Write-Host "Required for Round 6 update completed-------" $list.title
    }
else
{
Write-Host "Required for Round 6 not found in " $list.title
}
if( $list.Fields.ContainsField("Round 6 Result") -eq $true)
    {                                      
        Write-Host "Round 6 Result found and updating value in " $list.title
$listItms = $list.Items
foreach ($item in $listItms)
{
$item["Round 6 Result"]="Not Tested";
$item.Update();
}
Write-Host "Round 6 Result update completed-------" $list.title
    }
else
{
Write-Host "Round 6 Result not found in " $list.title
}
}

Friday, November 1, 2013

Display Native mode in SharePoint


To display SSRS reports running in native (Not Integrated mode) we have to follow these steps
For  Integrated mode, it is pretty straight forward.Intergrated mode is recommended way to go for most of scenarios.

For the native mode reports showing them is not straight forward
  • Copy RSWebPArts.cab found in \\DatabaseServer\c$\Program Files (x86)\Microsoft SQL Server\100\Tools\Reporting Services\SharePoint  to SharePoint server.
  • Run following stsadm command or equivalent  Powershell command

STSADM.EXE -o addwppack -filename "local directory\RSWebParts.cab" -globalinstall
Install-SPWebPartPack -LiteralPath "localdirectory/RSwebparts.cab" -GlobalInstall

  •  In the sharePoint page that you want to show the report, clikc on page ->  Edit to edit page
  • Insert Report viewer webpart by selecting it from Miscellaneous group

  •  Edit the webpart and enter the URL for Reports, for ex: http://RSserver/Reports
  • and in the ReportPath enter /Report  (without the .RDL extension)