Check Whether SharePoint Group Exists

  • Thread starter Thread starter Fao, Sean
  • Start date Start date
F

Fao, Sean

I was wondering if there was any way to programmatically determine
whether or not a group exists in SharePoint. I checked the
SPGroupCollection in the SPWeb.SiteGroups property and didn't see any
methods for doing lookups. I could obviously write my own code that
loops through each group, but I was wondering if there was an
easier/cleaner way to accomplish this task.

Thank you in advance,
 
I was wondering if there was any way to programmatically determine
whether or not a group exists in SharePoint. I checked the
SPGroupCollection in the SPWeb.SiteGroups property and didn't see any
methods for doing lookups. I could obviously write my own code that
loops through each group, but I was wondering if there was an
easier/cleaner way to accomplish this task.

Thank you in advance,

what about loop?

foreach(SPGroup spGroup in spWeb.SiteGroups)
{
....
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top