// All domain users and groups
// that are Security Principals for the website
// This is the list you see in /_layouts/user.aspx
SPUserCollection users = web.Users;
Response.Write("All domain user principals in this site: " + "
");
foreach (SPUser user in users)
{
Response.Write(user.Name + "
");
}
// All domain users and groups within the site collection
users = web.SiteUsers;
Response.Write("All users in this site collection: " + "
");
foreach (SPUser user in users)
{
Response.Write(user.Name + "
" );
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment