SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to check account who created list view in Sharepoint 2013

share|improve this question
    
Please provide more information, like how do you want to get the account, programmatically or in UI, etc. – Karthik Jaganathan Jan 20 at 7:01
up vote 6 down vote accepted

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

share|improve this answer
1  
Thank you very much for your support – Nguyễn Việt Jan 20 at 6:47

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.