Skip to main content

Posts

Showing posts with the label SharePoint 2010

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        ...

Convert classic users to claims using PowerShell

# START INITIALISATIONS Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue #Initialise Web $web = Get-SPWeb -identity "site collection URL" #Initialise Sharepoint list $list = $web.Lists["Site Owner Survey Input Form"]     write-host $web write-host $list #Initialise AD $_Searcher= New-Object System.DirectoryServices.DirectorySearcher $_Searcher.PageSize = 1000 # END INITIALISATIONS # START Main Code $filepath = "D:\MyInput.csv" Import-CSV $filepath | foreach-object{ $siteurl = $_.siteurl $landid = $_.lanid $sameaccountname = $landid write-host $siteurl write-host $landid write-host $sameaccountname   $claim = "i:0ǵ.t|federation.global.xyz.com|" + $sameaccountname $cp = New-SPClaimsPrincipal -Identity $claim -IdentityType "EncodedClaim" $user = $web.EnsureUser($cp.ToEncodedString())                     $newItem = $list.Items.Add() $newItem["Title"] = $siteurl; $newIte...

People Picker dialogue is blank / Choose folder dialogue under upload documents is blank

People Picker dialogue is blank / Choose folder dialogue under upload documents is blank Resolution : This is because of the SQL Injection rules in the IIS site. Follow the below steps to fix the issue: Go to IIS Manager (inetmgr) Expand the Sites-> Select the Migration farm URL In the right side pane-> double click on "Request Filtering" Under the rules tab -> Remove the  rule for SQL injection Do the same on the extended site and as well on all the WFE servers in the farm Hope this helps someone.

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

PowerShell to continue from catch block if there is an error

Below code snippet will help you to continue from catch block if there is error, try{ [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")| Out-Null $Site = new-Object Microsoft.SharePoint.SPSite($siteCollUrl) $alertResultsCollection = @() $a = $ErrorActionPreference  $ErrorActionPreference = "SilentlyContinue" foreach($SiteColl in $Site.WebApplication.Sites) { if($SiteColl -ne $null) { Write-Host "Processing site " $SiteColl.URL Try{                 foreach ($web in $SiteColl.AllWebs)  { if($web -ne $null) { Try{ foreach ($alert in $web.Alerts) {                                             $alertURL = $web.URL + "/" $alertResult = New-Object PSObject $alertResult | Add-Member -type NoteProperty -...

"cannot update library or list" while publishing InfoPath form

This error comes when the column limit is exceeded in InfoPath form library because of the setting change happens when we take template from QA to PROD environments. Anyone should never use "Quick Publish" button on the ribbon of InfoPath in high risk environments and check every column mapped in Property Promotion window of publish wizard. The following CSOM code can be used to delete the duplicate columns(which are read-only) created because of the above error, ClientContext context = new ClientContext(sharePointSiteURL); Site oSite = context.Site; context.Load(oSite); Web web = context.Web; List doclist = web.Lists.GetByTitle("LibraryName"); context.Load(doclist); context.ExecuteQuery(); FieldCollection fieldCollection = web.Lists.GetByTitle("LibraryName").Fields; foreach (Field column in fieldCollection) {     if (column.InternalName.Equals("ColumnName"))     {         column.ReadOnlyField = false; ...

Resources for jQuery with SharePoint

Here are some nice resources for jQuery with SharePoint, http://msdn.microsoft.com/en-us/library/gg701783%28v=office.14%29.aspx http://blogs.msdn.com/b/yojoshi/archive/2010/06/17/using-jquery-with-sharepoint-2010.aspx http://www.codeproject.com/Articles/544538/JQuery-with-SharePoint-2010 http://www.threewill.com/2012/01/adding-jquery-to-sharepoint/

Great URLs to Design and Develop MOSS 2007 and SharePoint 2010 Apps

Following are the useful links while designing and developing MOSS 2007 and SharePoint 2010 applications, I'll keep updating this list http://office.microsoft.com/en-in/sharepoint-designer-help/workflow-actions-in-sharepoint-designer-2010-a-quick-reference-guide-HA010376961.aspx http://www.fusecollaboration.com/Blog/archive/2011/10/10/recovering-workflow-history-after-60-days.aspx http://technet.microsoft.com/en-us/library/cc288475.aspx http://vinaybhatia.blogspot.in/ http://nileshmandekar.blogspot.in/ http://www.sharepointkings.com/ http://www.heathersolomon.com/blog/ http://www.andrewconnell.com/blog/ http://blog.tedpattison.net/ http://www.harbar.net/ http://toddbaginski.com/blog/ http://www.sharepointpodshow.com/Default.aspx http://www.binarywave.com/blogs/eshupps/default.aspx   http://www.thorprojects.com/blog/default.aspx   http://claytonj.wordpress.com/ http://technet.microsoft.com/en-us/library/cc262788.aspx http://technet.microso...