Sharepoint Data Access via CAML Query and SPQuery

CAML Queries are most commonly used  for easily accessing  data inside SharePoint. SharePoint object model provides many useful Classes which use CAML queries for fetching the data you need (listed below). These classes are fine tuned for specific scenarios. SPQuery ContentIterator SPSiteDataQuery PortalSiteMapProvider…

SharePoint Copy Documents from one document library to another using server object model.

You can use this function created by Julie Turner. Function takes two parameters SPListItem itmSource which is the source item to move, and SPDocumentLibrary libDest which is the target document library. SPFile fileSource = itmSource.File; /*Here we’ll get the created…

Sharepoint Find and remove duplicates in the list using Powershell

Add-PSSnapin microsoft.sharepoint.powershell $web = Get-SPWeb -Identity “” $list = $web.Lists[“List Name”] $AllDuplicates = $list.Items.GetDataTable() | Group-Object title | where {$_.count -gt 1} $count = 1 $max = $AllDuplicates.Count foreach($duplicate in $AllDuplicates) { $duplicate.group | Select-Object -Skip 1 | % {$list.GetItemById($_.ID).Delete()}…

Sharepoint Bulk Delete list items using Powershell

param($weburl,$listname) if ($weburl -eq $null -or $listname -eq $null) { write-host -foregroundcolor red “-weburl or -listname are null.” return }   Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0 $web = get-spweb $weburl $list = $web.lists[$listname]   $stringbuilder = new-object System.Text.StringBuilder   try {…

Sharepoint Copy List Permission using Sharepoint Powershell

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue   #PowerShell Function to copy permissions between Lists in SharePoint Function Copy-ListPermissions() { param( $WebURL, $TargetWwebURL, $SourceListName, $TargetListName ) #Get the Web $Web = Get-SPweb $WebURL $TargetWeb=Get-SPweb $TargetWebURL #Get Source and Target Lists $SourceList = $Web.lists[$SourceListName]…

SharePoint 2010: Get List of All Web Applicatons/Site Collections/Sub-Sites/Permissions and Last Modified using PowerShell

#GET ALL WEB APPLICATIONS IN THE FARM $webApp = Get-SPWebApplication #FOREACH LOOP, LOOPING THROUGH ALL WEB APPLICATIONS IN THE FARM foreach ($webApps in $webApp) { #WRITE-HOST WEB APPLICATION NAME write-host “WEBAPP:” $webApps.Name #FOREACH LOOP, LOOPING THROUGH ALL SITE COLLECTIONS WITHIN…

Page 1 of 2912345...1020...Last »
%d bloggers like this: