我正在尝试使用以下脚本枚举SharePoint环境中的用户配置文件:
$sc = [microsoft.sharepoint.spservicecontext]::getcontext((get-spsite $url))
$upm = new-object microsoft.office.server.userprofiles.userprofilemanager($sc)
$upm.getenumerator()
但在执行时,我收到以下错误:
An error occurred while enumerating through a collection: Database error while queueing user profiles..
其他一些有用的信息:
$upm.count = 0
$sc.sitesubscriptionid = all zeroes
用户个人资料枚举器应返回数百个用户个人资料。 是的,我是User Profile服务的管理员,是的,我在用于获取服务上下文的网站集上有网站集管理员。
这条错误消息在互联网上没有显示出来,所以我觉得这里值得一提,即使这对我的解决方案来说并不是那么重要,我解决了它。