Permissions Web Part: List of Site Owners

How would you like to have a nice pretty web part on the home page of each of your sites, showing a dynamic list of the people who are in the owners group for that site?  This is a great idea, because it gives the site users a quick reference list so that they know who to contact if they have questions about that site.

CropperCapture[54]

This solution is applicable in any version of SharePoint 2010 or 2007.

  1. First, you need to double-check your group settings.  If you want to be able to display it in a web part, the membership needs to be visible to everyone.  In Site Settings –> People and Groups, go to your group, and click Settings in the toolbar and Group Settings.  On that page, Who can view the membership of this group needs to be Everyone.
  2. Open your site in SharePoint Designer.
  3. In SharePoint Designer 2010, click Data Sources on the left. (If you have SharePoint 2007, here is my video on how to do web services in SPD 2007)
  4. Click the SOAP Service Connection button at the top.
  5. Go to the Login tab, and choose Use Windows Authentication.
    CropperCapture[48]
  6. Go back to the Source tab.
  7. Type or paste in your site’s URL in the Service description location box, with /_vti_bin/usergroup.asmx at the end of it.  So mine looks like this:
    http://laurarogers.sharepoint.com/_vti_bin/usergroup.asmx
    (This can just be the root of your site collection.  All of the sub-sites will have the same list of users and groups, so this URL won’t have to be changed for each different sub-site that you use this web part on)
  8. Click the Connect button.
  9. For the Port, I usually pick UserGroupSoap12, but I’m not sure if it matters which one you pick.
  10. In the Operation drop-down box, choose GetUserCollectionFromGroup.
  11. In the Parameters section, double-click groupName.  Type the name of your SharePoint group in the Value box.  Also, be sure to check the box The value of this parameter…
    Click OK.
    CropperCapture[47]
  12. Your screen should look something like this.
    CropperCapture[49]
  13. On the General tab, type the Name Site Owners.  Click OK.
  14. Create a blank (temporary) web part page in order to create a new data view web part.  (one way: in the browser, click Site Actions –> More Options… –> choose Web Part Page, and click Create. This will let you name the file and put it in any library)
  15. In SharePoint Designer, open the new page you created.  (You can click the little pushpin icon next to All Files on the left, and drill down to the library you put this new page in.  Open your new page and click Edit File.)
  16. Those blue rectangles on the page are web part zones.  Put your cursor in one of them.
    CropperCapture[51]
  17. Click the Insert tab at the top, click the Data View button in the ribbon, and click the name of your new Site Owners data connection in that list.  You may have to scroll down in the drop-down to see it.
    CropperCapture[52]
  18. Alright, there’s your list of site owners, but it’s a bit messy.  We don’t need all that stuff.  Click the Add/Remove Columns button in the ribbon.  Remove everything except the Name and email columns, and click OK.
  19. We’re going to make the email column a hyperlink to send each person an email.  You can alternately just remove the email column and leave just the name, and make the name a hyperlink instead.  Click to select the first person’s email address.  On the Insert tab, click Hyperlink.  In the Link To column on the left, click Email address.  In the Email address box, type mailto:{@Email}
    You can also type in a subject if you’d like, such as “Question about Team Site”.  Click OK.
    CropperCapture[53]
  20. Save the page.  With your cursor in the web part you just created, click the Web Part tab in the ribbon.  Click the To File button.  Save this .WEBPART file off to your desktop or wherever.
  21. Go to your home page, and upload and insert this new web part onto your page.  There’s your list of site admins!
  22. Now, you can STILL use this same web part on all the other sites in this site collection, without having to go back into SharePoint Designer.  In my example, I have a site called Project A, and the name of the owners group is Project A Owners.  Go to the Project A home page, and Upload and insert that same web part.
  23. Open the web part toolpane (Edit Web Part) of the new web part you just inserted.  Click the Parameters Editor button.
  24. Find the parameter that says Name=”groupName”, and you’ll see that the default value says “Team Site Owners” (from step 11).  Change the text of Team Site Owners to say “Project A Owners” instead. (Note that if you didn’t check the box in step 11, you won’t see your parameter here).
    CropperCapture[55]
  25. Click Save.  Click OK in the web part toolpane on the right side of the browser.
  26. Once you stop editing the page, and refresh the browser, you’ll see your new list of people, you just won’t see it immediately.  Done!

Note that I couldn’t get this to work in Office 365, because I can’t seem to get any of the web services to work in data view web parts like this.

Similar Web Parts

There are a couple of out of box web parts that do something similar, that are important to note.  (Thanks, Craig for your question about this in the comments below)

The Site Users web part will show a list of people who have permission to the site, and it lets you see their presence (online status) and quickly send instant messages to them or click on their name to see their profile.  In this particular case, I didn’t use this web part for a couple of reasons.  First of all, at this particular client’s workplace, they have no instant messaging client at all.  Secondly, most of the SharePoint groups simply contain active directory groups, which means that you wouldn’t be able to directly contact individuals.  The third reason was simply formatting.  They wanted the names displayed with the email address next to them.

The Contact Details web part is one that is very simple but pretty.  It lets you enter a single person’s name in the web part settings, and it displays some basic info about them, such as their picture, name and job title, with presence information.  Unfortunately, this is static information, and will not automatically change as people are added and removed from SharePoint groups.

10 comments

  • Hey Laura, thanks for this post. It was the perfect starting point for my dive into C# and Visual Studio(Just learning both of them). I figured there had to be an easier way to do this if I wrote it myself. I attempted to create this as a sandboxed web part in Visual Studio. Works pretty well so far, still trying to polish it up.

    Maybe I will release it when I’m done playing.

  • Craig Humphrey

    Why not just use the Site Users webpart? Then you get all the built-in goodness exposed by Outlook/SharePoint/Lync…

  • The Site Users webpart does not show membership to a particular group. The users would need to select a group from the list before any names show up. It may also show confusing information like system accounts, etc.

  • Chris – you are confusing me here (easily done) – Site Users web part can be pointed at ANY group. And system accounts really shouldn’t be in your Owners group.

    This demo of Laura’s is a nice alernative – but most of the time I use the Site Users Web Part and remove the toolbar options from it, so it’s just a list of names with presence.

  • Hi Laura,

    Very useful post! I was also wondering if we have an option to insert the page contact on each page dynamically – I have a metadata field for page owner for my site pages library and I was trying to display dynamically the name from the metadata field.

  • I’m using AD groups in my SP permission groups. Is it possible to have SP display who is in the AD groups?

  • Supriya,
    No, I’ve never found a way to do that dynamically. Would be nice, though.

    Bob,
    No, I can’t think of a way to do that.

  • Can you update this for SharePoint 2013? I tried on my own to hack through it but couldn’t get it working right.

    Thanks,

    DA

  • Is there a way to show site owners off of permission level instead of groups? Most of the sites that I’m working with, the owners never put anyone into groups. For some of these sites its hard to have them do “site clean up”.
    Thanks,

    Sal

  • Sal,
    I’m not sure, maybe that same web service has other related operations that you could try out, at step 10.

Leave a Reply