0


We can add an SPUser into an SPGroup by objSPGroup.Users.Add(objSPUser). I need to add SPUserCollection into one SPGroup.
How can i do it?

Dennis G
  • 21,405
  • 19
  • 96
  • 133
john
  • 121
  • 1
  • 3
  • 17

1 Answers1

2

SPGroup actually contains an SPUserCollection object, representing the containing users. I don't see how you could overload this. There also isn't any method to add a full SPUserCollection to a SPGroup.

What I think you are best of doing is to iterate through SPUserCollection.GetCollection (MSDN reference) users and adding them one by one to your SPGroup

Dennis G
  • 21,405
  • 19
  • 96
  • 133