Thursday, February 20, 2014

Find Who has Created / Modified a SharePoint View

Every wondered how to find the user who has created/modified a particular SharePoint view? and when it was created/modified? Well, There is no SharePoint UI to get these information! But using SharePoint object model, we can retrieve these data programmatically from SPFile object's properties.

Here is how I retrieved "Created By", "Created On", "Modified By", "Modified On" values using PowerShell:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Set these two variables accordingly
$WebURL  = ""
$ViewURL = ""

 #Get the Web
 $web = Get-SPWeb $WebURL

 #Get the View File
 $ViewFile = $web.GetFile($viewURL)
 Write-Host "Created By: " $ViewFile.Author 
 Write-Host "Created on: " $ViewFile.TimeCreated

 Write-Host "Modified By: " $ViewFile.ModifiedBy
 Write-Host "Modified On: " $ViewFile.TimeLastModified

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...