I would like to store in c# code some list or collection or what else to store SPUser and SPGroup objects. After this I would like to do some foreach loop and do some logic.
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
Based on a blog post I found, I have written the following code:
I don't like the fact that I have to impersonate every single user, and this code will only find AD users that have already been imported into SharePoint (so an |
|||
|
|
|
I have found the solution:
|
|||
|
|
I am not sure whether I understand your question correctly, but if you need to get some users and make foreach loop (and do some logic) on them on the same time when they were fetched and they will not be used later, you definetely need to use collection for it. If you need results of some logic later, you can save them to a list. |
||||
|
|

