Bulk delete SharePoint List items using CSOM
SharePoint CSOM enables us to delete bulk list items using browser console. Scenario-1: We have a list of records to be deleted from a SharePoint list and we do not want to delete record one by one. Scenario-2: We want to delete the list and list already had cross the […]
Making shift from Web to Mobile Development
MOBILE APPS are the latest tool to reach customer faster and gain that extra mileage against competitors. The reason behind this change from web to mobile apps is the alarming rise in the usage of mobile users. Constant development in mobile smartphones, the plethora of mobile apps from different app […]
SharePoint SPSiteDataQuery
SPSiteDataQuery is used to Query multiple lists or to read data from all the lists in a site collection. Get Combined result Below is the example to query multiple list data sources and get combined information in data table:
To set custom sub site icon in a custom master page.
I.e. For Sub Site – A: . For Sub Site – B: Below is the approach followed from me: Added below entry in master page but it was always resulting in wrong URL (404 URL not found) and referring to Site Collection URL (It was needed to refer sub site […]
Apply Background image to SharePoint 2010 site
Add below lines of CSS and done!!! <style type=”text/css”> BODY { background-image:url(“bg.png”) !important; background-repeat:no-repeat; BACKGROUND-COLOR: transparent !important; } .s4-ca { BACKGROUND-COLOR: transparent !important; } .ms-alternating,.ms-gb,.ms-alternatingstrong { background-color: transparent !important; } .ms-WPHeader { background-color: transparent !important; } </style>
Get extract of files modified after particular date from SharePoint library or folder within library (PowerShell script)
Function getFilesWithin($list) { foreach($item in $list.Items) { if ($folderURL -ne “”) { if ($item.Url.StartsWith($folderURL, “CurrentCultureIgnoreCase”)) { $targetFile = $item.file; if ($targetFile.TimeLastModified -ge (Get-Date $lastDate)){ $item.Name + “;” + $item.Url + “;” + “File;” + $($targetFile.TimeLastModified).ToString(‘dd/MM/yyyy’) | Out-File $logWrite -Append } else { write-host -f green “Not changed after given date” […]
How to update SharePoint’s Group Owner using PowerShell
#Enter the site URL for which the group owner needs to be updated $webUrl = “http://test.company.com/man” Write-Output “Getting site object” $web = Get-SPWeb $webUrl Write-Output “Success” Write-Output “Getting User Group” $spGroups = $web.groups #Get the owner group $UserGroup = $spGroups | where {$_.Name -eq “User”} Write-Output “Success” foreach($group in $spGroups) […]
How to Activate MIME Type using Powershell
$mime = “text/html” $webAppUrl = “http://test.company.com” $webApp = Get-SPWebApplication $webAppUrl If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains $mime) { Write-Host -ForegroundColor White “Adding MIME Type “$mime #$webApp.AllowedInlineDownloadedMimeTypes.Add($mime) #$webApp.Update() Write-Host -ForegroundColor Green “MIME Type added and saved.” } Else { Write-Host -ForegroundColor Yellow $mime” MIME type is already added.” }
Get document wise versions list using Powershell
function Get-DocumentItemVersionsList([string]$WebURL, [String[]]$listName) { [void][System.reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) set-variable -option constant -name out -value “C:\Get-ListItemVersionsList_Output.csv” “Item_ID|Item Title|Item URL|Version Count” | Out-File $out -Append write-host “–IN” $web = get-spweb $WebURL write-host “–Web initiated” $list = $web.Lists.TryGetList($listName) write-host “–List initiated” $listItems = $list.Items; write-host “–List Items Count = ” $listItems.Count foreach($item in $listItems) { $itemTitle […]
Delete all sharepoint list item using powershell
write-host “Type YES to continue” $retvalue = read-host if ($retvalue -ne “YES”) { write-host “exiting” -foregroundcolor green exit } write-host “continue” $web = get-spweb http://sharepointweburl:2015 $list = $web.lists | where {$_.title -eq “List Name”} Write-host “List $($list.title) has $($list.items.count) entries” $items = $list.items foreach ($item in $items) { Write-host ” […]
