If you’re doing an upgrade of an existing SharePoint Portal Server 2003 farm to Microsoft Office SharePoint Server 2007 you will undoubtedly run into the need to identify all site administrators in your SPS 2003 environment. If for no other reason than to notify them that their Themes will be lost during the migration to MOSS 2007, you’ll be in contact with these administrators. The question is… how do you identify all the site administrators? If you only have a hand full of sites, it can certainly be done manually, but if you dealing with a huge farm and thousands of sites, this is not practical. That is exactly where TSQL comes to the rescue. Now as you know, we are not allowed to directly update any of the SharePoint databases as this action would invalidate your support agreement with Microsoft and put your portal in an unsupported state. That doesn’t mean we can’t read from it. This little SQL query will deliver the results you are looking for:
USE SharePoint_SITE SELECT w.fullurl, w.title, u.tp_title, u.tp_login FROM webs w, userinfo u, webgroups g INNER JOIN webgroupmembership p ON g.webid = p.webid AND g.id = p.groupid WHERE g.type = 5 AND u.tp_id = p.memberid AND u.tp_siteid = g.siteid AND w.id = g.webid AND w.siteid = g.siteid ORDER BY w.fullurlThe WebGroups table defines all the web sites and they groups that was created for each. Joining it to the WebGroupMembership table provides us with the users that belong to the groups and from there we just have to get more user information and web site information from the UserInfo and Webs tables. If you wish to get a list of other standard user groups, just change the “g.type =” part of the statement as follows:
- Web Designer
Trackback from your site.