Target Audiences在弹出的people picker中不显示Alias列有空的项目
【客户需求】
当编辑webpart时,Target Audiences在弹出的people picker搜索时候,Alias列有空的项目,客户要求不显示Alias列有空的项目。

【分析】
首先这个“Distribution/Security Groups” 是来自AD中的Group,当user profile service同期后,会进入如下数据库表中。

尝试用LDAP进行filter,被证明这个办法对Group无效

【解决办法】
方法一:
在数据库里直接删除,但是不建议这样做,因为直接操作数据库会有风险。
方法二:
使用PowerShell删除没有mail地址的ad group项目
$url = "http://sp2016-3:36406"; $SPSite = get-spsite $url; $context = [Microsoft.SharePoint.SPServiceContext]::GetContext($SPSite) $manager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager $context $sourceMethod = [Microsoft.Office.Server.UserProfiles.MemberGroup].getmethod("get_MailNickName") $deleteMethod = [Microsoft.Office.Server.UserProfiles.MemberGroup].getmethod("Delete") foreach ($memberGroup in $manager.GetMemberGroups()) { if ($sourceMethod.Invoke($memberGroup, @()) -eq "(null)") { $deleteMethod.Invoke($memberGroup, @()) } }
相关推荐
EdwardSiCong 2020-11-23
yungpheng 2020-10-19
jipengx 2020-11-12
橄榄 2020-11-03
lyqdanang 2020-11-02
wservices 2020-10-30
onepiecedn 2020-10-29
数据人 2020-10-26
dfphoto 2020-10-16
hackerlpy 2020-09-07
tianyayi 2020-08-16
Dullonjiang 2020-08-15
fengling 2020-08-15
wordmhg 2020-08-06
guotiaotiao 2020-08-06
zhangsyi 2020-07-28
千锋 2020-07-27
ahnjwj 2020-07-28