question

RakeshKumar-9329 avatar image
0 Votes"
RakeshKumar-9329 asked ElsieLu-MSFT commented

Sharepoint Site Owner using Database query

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.

office-sharepoint-server-administrationsharepoint-devoffice-sharepoint-server-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

WendyLi-MSFT avatar image
0 Votes"
WendyLi-MSFT answered ElsieLu-MSFT commented

@RakeshKumar-9329

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://docs.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.



image.png (118.9 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RakeshKumar-9329 , have you tried the solution? Any updates are welcomed.

0 Votes 0 ·
ElsieLu-MSFT avatar image
0 Votes"
ElsieLu-MSFT answered RakeshKumar-9329 commented

Hi @RakeshKumar-9329 , 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.



91.png (15.3 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the response..
The problem is i don't have access to the SharePoint UI and its a very lengthy process to get the access to Sharepoint UI.

0 Votes 0 ·

Hi, thanks for the reply. If you can access the SharePoint Server side, then you can try to run this powershell command, which does not need to operate on the UI interface. If you only have the read permission on the SQL Server side, you may need to ask a colleague with higher permission or the IT department for help. :)

0 Votes 0 ·