[SharePoint 2010/2007] Get the User Who Created a List or Library

A user on one of the forums had a need to find out who the creator of a SharePoint List (or Document Library) was. The SharePoint GUI gives no way to identify this from the list settings or anywhere else for that matter.

With that said, it is possible to retrieve this out of the database in two ways: 1) For SharePoint 2007 and 2010, the database can be queried directly -or- 2) For SharePoint 2010 Only, it can be retreived using PowerShell.

To get the author of the list or document library from SQL:

  1. Get the List ID. You can do this by going to the list in the web browser and going to the List Settings. The URL should have something like:

    /_layouts/listedit.aspx?List=%7BC758FFC6%2DD14F%2D4820%2D8EE2%2D8805C1EE1B41%7D

    %7BC758FFC6%2DD14F%2D4820%2D8EE2%2D8805C1EE1B41%7D is the List ID in a URL encoded format. Remove %7B and %7D from the beginning and the end and replace the %2D’s with hyphens (-). In this example it would be:

    C758FFC6-D14F-4820-8EE2-8805C1EE1B41

     

  2. With SQL Server Management Studio, connect to the SQL server for the SharePoint Site and goto the Content database for the site collection you are working with (something like WSS_Content, yada yada yada).

     

  3. Query the dbo.Lists view where the tp_ID is equal to the List ID we just got. For example:

    SELECT *
    FROM [WSS_Content].[dbo].[Lists]
    WHERE [tp_ID] = 'C758FFC6-D14F-4820-8EE2-8805C1EE1B41'

     

  4. Get the tp_Author value. This is the SharePoint database ID for the user in question.

     

  5. Query the dbo.UserInfo table where the tp_ID is equal to the author ID you just retrieved. For example:

    SELECT *
    FROM [WSS_Content].[dbo].[UserInfo]
    WHERE tp_ID = '1073741823'

     

  6. This may display multiple records, but it will all be the same user. The tp_Login field will display the Active Directory account you are looking for.

For SharePoint 2010, to get the author from PowerShell:

  1. Open SharePoint 2010 PowerShell from one of the SharePoint servers in the farm.

     

  2. Run the following PowerShell commands:

    $web = Get-SPWeb "http://yoursiteurl"
    $list = $web.lists["Your List Name"]
    $listAuthor = $list.Author
    Write-Host $listAuthor

     

  3. This will return the username of the person who created the list.

If you were looking to do just this, I hope this helps.

John Chapman

Hello, I'm John Chapman. I am a SharePoint Developer for Sitrion (formerly NewsGator) living in Denver, Colorado. I develop solutions using SharePoint and .NET, and I thrive on the challenge of writing code to overcome the impossible, annoying, or otherwise difficult obstacles.

More Posts - Website - Twitter - LinkedIn - Google Plus

  • http://www.n8d.at/blog Stefan Bauer

    Nice Powershell stuff. What you actually have forgotten to mention is that direct SQL Queries to a SharePoint Content Database are not supported by Microsoft and can have impact on the performance of the server.
    When this should be used in an application the Author property of SPList Object should be used.

    Regards Stefan

    • Jen

      I understand how Microsoft frowns on messing with the SharePoint tables (because they don’t want to support it if someone in fact messes them up). However I don’t see how such a small query could cause a performance loss that would even be noticeable when ran.

      It may not be supported to use SQL but it is effective when necessary :/

  • Jen

    Hi John,
    Thank you for your post. It worked perfectly. It was cool to see see how both ways returned the results.