Sunday, August 25, 2013

How to get a list of all users in SharePoint


All users that exist in a SharePoint web (but don't necessarily have permission):
Users that exist in a SharePoint web but have been granted some permission:
Users that exist in a SharePoint site collection (but don't necessarily have permission):
Note: I am assuming you are using WSS 3.0 / MOSS 2007 but this should work for WSS 2.0.
Also look at:

eg:-
Dim Site As New SPSite("SiteURL")
Dim AllUsers As SPUserCollection = Site.RootWeb.AllUsers
Dim u As SPUser
For Each u In AllUsers
    Response.Write(u.LoginName & " " & u.Name & " " & u.Email & "<br />")
Next


No comments:

Post a Comment