Skip to main content

Posts

Showing posts with the label power shell

Add Rating to sharepoint list on site collecion using power shell

ShellScript: [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")   $site = New-Object Microsoft.SharePoint.SPSite("http://sitecollection URL")   $web=$site.OpenWeb()   if ($web -ne $Null)   {         $AverageRating=$web.Fields[[System.Guid]"5a14d1ab-1513-48c7-97b3-657a5ba6c742"]         $RatingCount=$web.Fields[[System.Guid]"b1996002-9167-45e5-a4df-b2c41c6723c7"]         $PagesList=$web.lists["Pages"]         if ($PagesList -ne $Null)         {               Write-Host " Processing List : " $PagesList.Title               $ct=$PagesList.ContentTypes["Page"]           ...

Apply Custom Master Page To Site using Power Shell

function ApplyMasterPageToSearchSite([string] $siteURL, [string] $SiteName) {         $subsiteurl = $siteURL + "/" + $SiteName + "/default.aspx"         Enable-SPFeature -identity "94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb" -url $subsiteurl         Start-SPAssignment -Global         $site = Get-SPSite $siteURL         Write-Host "Get the Site" -foregroundcolor green         $topWeb = Get-SPWeb $site.Url         Write-Host "Update Master Page to search" -foregroundcolor green         $site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = "/_catalogs/masterpage/LMSSearchMaster.master";$_.Update() }         Write-Host "Master Page assigned" -foregroundcolor green         Stop-SPAssignment -G...