Sharepoint - How to check who created list view in SharePoint 2013

You cannot get the information who a view created because it's not cover by the object model. The SPView object doesn't store a property for modified or created. To get the information all you can do is to get the information from the file. So for the view "All Items" you need to request the file allitems.aspx.

The SPFile object stores the "Created", "Created by", "Modified" and "Modified by" values.

The PowerShell Script looks like this:

# define variables for script
$SiteUrl = "http://yourserver/sites/yoursite"
$viewurl = "http://yourserver/sites/yoursite/Lists/customlist/AllItems.aspx  "

$targetUrl = Get-SPWeb -Identity $SiteUrl
if ($targetUrl -ne $null)
{
    $targetFile = $targetUrl.GetFile($viewurl)

    if($targetFile.Exists)
    {
        Write-Host "Created By: " $targetFile.Author
        Write-Host "Modified: " $targetFile.TimeLastModified
        Write-Host "Modified By: " $targetFile.ModifiedBy
        Write-Host "Created: " $targetFile.TimeCreated
    }
    else
    {
        Write-Host "File doesn't exist"
    }
}

Hope this helps ! Source


As you have tagged SharePoint Apps, You need the client side solution I guess. Following is the REST API solution.

@Bhaskar already mentioned that SPView does not store the info who has created it. But when we create a view, SP creates a file like viewName.aspx. We can get this file path by following request.

/_api/web/lists/getByTitle('List Name')/Views?$select=ServerRelativeUrl

It will return the ServerRelativeUrl's of all views. Now if we know the ServerRelativeUrl of a view, then we can find all information (Author, ModifiedBy) by following request

/_api/web/getfilebyserverrelativeurl('/Lists/ListName/AllItems.aspx')?$expand=Author

Tags: