一些用户不在siteUserInfoList中

时间:2013-06-27 18:47:46

标签: sharepoint

我有一个脚本列出在sharepoint上拥有帐户的所有用户。但是,并非所有这些都被列出。例如,仅列出了5/8标记。

我正在使用PowerShell和查询:

"<Query><OrderBy><FieldRef Name='ID' /></OrderBy></Query>"

我不知道为什么没有全部展示。我可以在门户网站和管理中心下找到它们。

3 个答案:

答案 0 :(得分:2)

用户在登录网站或授予特定权限(而不是通过AD组)时会添加到用户信息列表中。

您可以在How is the user information list populated?

上阅读有关SharePoint.StackExchange.com的更多信息

答案 1 :(得分:2)

您可以编写PowerShell脚本(名为ListWebUserInformationListItems.ps1),如下所示:

# Run with SharePoint 2010 Management Shell
$webUrl = Read-Host "Enter the web url"
$web = Get-SPWeb $webUrl
$list = $web.Lists["User Information List"]
$query = New-Object Microsoft.SharePoint.SPQuery
$queryCamlString = '<Query><OrderBy><FieldRef Name="Title" Ascending="True" /></OrderBy></Query>' 
$query.Query = $queryCamlString
$userInformationListItems = $list.GetItems($query)
foreach($userInformationListItem in $userInformationListItems)
{
    echo $userInformationListItem.Title
}

然后执行脚本并在控制台窗口显示“输入网址”消息时输入网址。

注意:您可以使用SPQuery获取此Web应用程序中用户的用户信息列表项。用户不是服务器场中的所有用户。如果将ADGroup添加到SharePoint,则会将唯一一个SharePoint用户添加到用户信息列表(ADGroup的SharePoint用户站,ADGroup中的ADUser将不会显示给用户信息列表)。

用户信息列表项目标题将显示在控制台窗口中。 enter image description here

更多: 您可以访问“http://[your Web应用程序URL] / _ catalogs / users / detail.aspx”来查看Web应用程序中的用户。 enter image description here

希望答案能帮到你

答案 2 :(得分:1)

我认为您可能会通过列出所有用户个人资料来改善。通过执行此操作,您至少会获得已同步到SharePoint的所有用户的列表。类似的东西:

$site = Get-SPSite "your URL"
$context = Get-SPServiceContext $site 
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
$profiles = $profileManager.GetEnumerator()

foreach($profile in $profiles)
{  
    $displayName = $profile.DisplayName  
}
相关问题