Find All Documents Created or Modified by a Particular User in Specific Date Time

Requirement is to find all documents which are uploaded to the SharePoint environment during the past one Month. PowerShell can do the reporting well. Lets see the code: Same way, we can find all documents uploaded to SharePoint sites based on Date criteria by just checking $item.File.TimeLastModified property. Say For instance, You…

Read more

Find All Large Files and Generate Report in SharePoint using PowerShell

Requirement: Find large files in SharePoint. SharePoint is not the replacement for network file shares when it comes to large files, archival. Detailed article here: SharePoint vs Network File Share – Which is best?. But who cares? End-Users started uploading large files which made us add few more disks to SQL Server….

Read more

Empty SharePoint Recycle Bins Programmatically with PowerShell

Requirement: Empty recycle bin in SharePointIn a Database attachment method migration project, we decided to clear all the recycle bins to get some additional free space in databases. There were 3000+ site collections. Automation? SharePoint Automation = PowerShell 🙂 Empty SharePoint Site Collection Recycle bin using PowerShell: The Recycle bin in SharePoint…

Read more

Delete Attachments from SharePoint List Items using PowerShell

Requirement: Delete Attachment from SharePoint List Item How to Remove an Attachment from a List Item in SharePoint? There is a requirement to delete all the attachments named as “xyz.presales.document.docx” from a SharePoint List where 100’s of list items already created with a lot of attachments. Attachments can be removed from a…

Read more

Get SharePoint Recycle Bin Storage Size using PowerShell

In a Database attachment method migration project, wanted to get the insights on how much space being occupied by SharePoint Admin Recycle bin for all site collections. There were 3000+ site collections. PowerShell Script to get First Stage recycle bin size: Here is the PowerShell script to get the 2nd stage recycle…

Read more

Delete or Restore SharePoint Recycle Bin Items based on Deleted Date using PowerShell

Requirement is to Restore all the Items deleted before last week from Recycle bin, which were already deleted from End-User Recycle bin (1st Stage Recycle bin).

Read more

How to Create SharePoint List or Library Programmatically?

At times, We may have to create List or Document Libraries programmatically. These code snippets will help to get it done. Create a Document Library in SharePoint Using .Net Object Model (C#) For all available List template types, Refer: SPListTemplateType Create a SharePoint List using PowerShell:

Read more

Activate-Deactivate Features Programmatically in SharePoint

At times, We may have to activate/deactivate features programmatically. Here is the code snippet: PowerShell way to Activate-Deactivate Features: To activate a feature in PowerShell: Enable-SPFeature -identity <Feature-Folder-Name/GUID> -URL <URL-of-Web-app/Site coll/Site> To deactivate a feature: Disable-SPFeature -identity <Feature-Folder-Name/GUID> -URL <URL-of-Web-app/Site coll/Site>

Read more

Set Sorting, Filter, Group By in SharePoint Views Programmatically

SharePoint List views uses CAML internally to Filter, Sort list items. In a Recent project, we had to programmatically set the Filter and Sort order of default views. How to Get the CAML? Simple! use U2U CAML Query builder, one of my favorite SharePoint tool. C# code to set the View Filter,…

Read more