Sharepoint Site Owner using Database query

Rakesh Donthi 21 Reputation points
2021-10-18T16:43:29.423+00:00

Hi All

I have the read access to the SharePoint DB's only but not to UI's (its not easy to get the access).
Now i want to view the Site Owner who created the SP site.
is there any way where i can view the details of the Site Owner who created the Site from the database.

Any clue will really help me.

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,657 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,569 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,794 questions
0 comments No comments
{count} votes

Accepted answer
  1. Wendy Li_MSFT 1,711 Reputation points Microsoft Vendor
    2021-10-25T09:40:58.12+00:00

    @Rakesh Donthi

    Is the site you mentioned a website or a site collection?

    All data of sites is stored on the related web application content database (its name is like WSS_Content_xxx), there is a table UserInfo stores descriptive properties and security information about principals with access to a site collection. In the table, tp_ID is the User Identifier of the principal. Certain User Identifiers are predefined, such as the system account (1073741823), the site collection owner (1), and the secondary site collection contact (2).

    So, you can use where tp_ID=1 to find the site collection owner's information, like the following query:

    143423-image.png

    More information about UserInfo table:
    https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-wssfo3/6c3a31c9-475c-42ef-b5e4-689d60b1ee82

    Please have a try and let's know the result.

    If I misunderstand your meaning, please feel free to reply.

    ---------------------

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Elsie Lu_MSFT 9,756 Reputation points
    2021-10-19T07:39:50.11+00:00

    Hi @Rakesh Donthi , welcome to Q&A forum!

    Per my knowledge, usually we don't look up on the database side. If you want to know the owner of a site, you can go to the SharePoint Server and open windows powershell. Run the following code:

    $webApp = Get-SPWebApplication("http://sp")  
    foreach ($site in $webApp.Sites)  
    {  
    write $site | format-table -property Url,Owner,Quota  
    }  
    

    Test Result:
    141627-91.png

    Reference:
    Find Site owners with Powershell


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.