Skip to main content

Posts

Showing posts from 2015

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; $newItem[&q

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 -name "List_URL" -value $alertURL $alertResult | Add-Member -type NoteProperty -name "Alert_Title&quo

Compare 2 CSV files and store result in 3rd CSV file using PowerShell

Below script is to compare 2 CSV files and store result in 3rd CSV file using PowerShell, $file1 = Import-CSV -Path "C:\A.CSV"  $file2 = Import-CSV -Path "C:\B.CSV" $result = Compare-Object -ReferenceObject $file2 -DifferenceObject $file1 -Property List_URL -PassThru If ($result) {     $result | Export-CSV C:\C.csv -NoTypeInformation }

Imporant technical help links for SharePoint 2013 Development

1. Expand & Collapse Content Query Webpart  http://social.technet.microsoft.com/Forums/en-US/7d601e67-8957-42a8-abfb-7cbcc61b1c24/expandcollapse-groups-in-content-query-web-part-in-sharepoint-2010?forum=sharepointcustomizationprevious http://social.msdn.microsoft.com/Forums/en-US/c15fe870-76e6-4a11-b5bd-e70110be41a8/collapse-groups-in-content-query-web-part http://store.bamboosolutions.com/sharepoint-data-viewer-web-part.aspx (using bamboo chart API) 2. Adding alias name to Sharepoint site http://social.technet.microsoft.com/Forums/sharepoint/en-US/b76cf17d-85cb-4a5e-9f7b-e0efdf438667/add-alias-url-for-a-sharepoint-site?forum=sharepointadminlegacy http://www.mssharepointtips.com/tip.asp?id=929&page=1 http://www.mssharepointtips.com/tip.asp?id=1102&page=2 3. Backing up and restoring Sharepoint site http://office.microsoft.com/en-in/windows-sharepoint-services-it/backing-up-and-restoring-web-sites-HA001160826.aspx http://www.sharepoint-journey.com/backup-and-restore-sha