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?
Asked
Active
Viewed 1,077 times
0
1 Answers
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
-
2Sounds like a good candidate to add an extension method to the SPGroup or the SPUserCollection – Francois Verbeeck Dec 20 '10 at 09:12