I was wanting to build a web control that did a few things for admins of a site. One of the processes was to add a user to the default members group of the site along with some other security settings. This was to help admins do all of this on one page instead of going to each group individually to add a user.
Here is the code I am currently using to accomplish this:
web.Groups("AR Test Site Members").AddUser(newStaff.User)
This work fine on my test site, but when I move it over to production that group name will change to the [Site Name] Site Members. I noticed that you could also used an index of the group instead of the name, so I used '5' because I noticed that was in the query strings for the address to look at the group members. When I used '5', I get an argument out of range error. How can I find the index number of this default group so that when I build the code I don't have to worry about finding out which site I'm on?