Skip to main content

Posts

Showing posts with the label Migration

Delete a particular web part from all the sites ans sub sites

Please us below PowerShell script to delete a particular web part from all the sites ans sub sites, Add-PSSnapin "Microsoft.SharePoint.PowerShell" #$CSVFile = Import-CSV -Path "E:\Ulhas\Subsites.csv" $filepath = "E:\Ulhas\Subsites.csv" Import-CSV $filepath -Header SiteUrl | Foreach-Object{     $SPweb = Get-SPWeb $_.SiteUrl #"https://www.contoso.com/it/pmo/"     $webpartmanager = $SPweb.GetLimitedWebPartManager(($SPweb.Url + "default.aspx"),  [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)        $webpartsarray = @()      For($i=0;$i -lt $webpartmanager.WebParts.Count;$i++)       {         if($webpartmanager.WebParts[$i].title -eq "ScriptToRemoveBlankSpace")  #Check for particular web part          {           $webpartsarray = $webpartsarray + $webpartmanager.WebParts[$i].ID        ...

Permission audit report for site and all sub sites using PowerShell

Use below script to get Permission audit report for site and all sub sites using PowerShell, Add-PSSnapin "Microsoft.SharePoint.PowerShell" $URL="https://intranet.contoso.com/sales/mysite/"      $site = Get-SPSite $URL      #Write the Header to "Tab Separated Text File"         "Site Name`t  URL `t Group Name `t User Account `t User Name `t E-Mail" | out-file "E:\Ulhas\UsersandGroupsRpt.txt"          #Iterate through all Webs       foreach ($web in $site.AllWebs)       {         #Write the Header to "Tab Separated Text File"         "$($web.title) `t $($web.URL) `t  `t  `t `t " | out-file "E:\Ulhas\UsersandGroupsRpt.txt" -append          #Get all Groups and Iterate through            foreach ($group in $Web.groups)         ...

Article page showing HTML tags in SharePoint 2013

Article page showing HTML tags, use below PowerShell to fix as mentioned here : http://labs.steveottenad.com/publishing-columns-show-escaped-html-in-sharepoint-2010/ Add-PSSnapin "Microsoft.SharePoint.PowerShell" $web = Get-SPWeb "https://contoso.com/sites/mysite/it/" $list = $web.GetPublishingPages(); foreach ($page in $list.Items) {     if ($page.Title -eq "Testing123")     {         [Microsoft.SharePoint.Publishing.Fields.HtmlField]$field = [Microsoft.SharePoint.Publishing.Fields.HtmlField]$list.Fields[“Page Content”]         $field.RichText = $true         $field.RichTextMode = [Microsoft.SharePoint.SPRichTextMode]::FullHtml         $field.Update()         break;     } } $list.Update() $web.dispose() Hope this helps!!!

Apply page layout for a particular page in SharePoint 2013 using PowerShell

In this article we will see how to apply page layout for a particular page in SharePoint 2013 using PowerShell, $spWeb = Get-SPWeb("https://server.com/sites/MyWeb") $spFile = $spWeb.GetFile("https://server.com/sites/Pages/MyPage.aspx") $spFile.CheckOut("Online",$null) $spFile.Properties["PublishingPageLayout"] = "/sites/_catalogs/masterpage/PageLayout.aspx" $spFile.Update() $spFile.CheckIn("Update page layout via PowerShell",[Microsoft.SharePoint.SPCheckinType]::MajorCheckIn) $spWeb.Dispose() Hope this helps!

Migrated content verification from MOSS 2007 to SharePoint 2010/2013

The below links may help for migration/upgrade of SharePoint environment, http://community.rightpoint.com/blogs/viewpoint/archive/2015/03/29/create-and-compare-a-source-and-target-site-inventory-using-powershell.aspx http://www.sharepointpals.com/post/Activities-to-be-performed-before-Upgrade-Migrate-from-SharePoint-2010-to-SharePoint-2013 Upgrade Worksheet from MS-  http://www.microsoft.com/en-us/download/details.aspx?id=30370