SharePoint - Get a list of current users

前端 未结 2 427
庸人自扰
庸人自扰 2020-12-16 21:22

What\'s the best way to get a list of users that are assigned to a SharePoint portal?

2条回答
  •  甜味超标
    2020-12-16 22:17

    It depends on exactly what list of users you want.

    All users that exist in a SharePoint web (but don't necessarily have permission):

    SPWeb.AllUsers

    Users that exist in a SharePoint web but have been granted some permission:

    SPWeb.Users

    Users that exist in a SharePoint site collection (but don't necessarily have permission):

    SPWeb.SiteUsers

    Note: I am assuming you are using WSS 3.0 / MOSS 2007 but this should work for WSS 2.0.

    Also look at:

    SPWeb.AllUsers vs. SPWeb.Users

    SPWeb.AllUsers vs. SPWeb.Users vs. SPWeb.Groups

提交回复
热议问题