SharePoint 特殊用户标识

To get claim for All Authenticated Users in PS you need to use:
$claim = New-SPClaimsPrincipal -EncodedClaim "c:0(.s|true"

for windows users (NT AUTHORITY\authenticated users):
$claim = New-SPClaimsPrincipal -EncodedClaim "c:0!.s|windows"

and for all forms authenticated users (basic asp.net membership provider)
$claim = New-SPClaimsPrincipal -EncodedClaim "c:0!.s|forms:aspnetsqlmembershipprovider"

NOTE: Need to use EnsureUser() or else the add method will not work.

$allAuthenticatedUsers = $web.EnsureUser(“c:0!.s|windows”);
$web.AssociatedVisitorGroup.Users.Add($allAuthenticatedUsers,””,”c:0!.s|windows”,””)
$web.update()

 

http://sptrac.com/wordpress/?p=88

posted @ 2018-11-30 14:39  霖雨  阅读(273)  评论(0编辑  收藏  举报