导出SharePoint2013用户及权限
cls
Add-PSSnapin Microsoft.SharePoint.PowerShell -ea 0
$site = New-Object Microsoft.SharePoint.SPSite("http://sitecollection") $webs = $site.AllWebs ## export by user foreach($web in $webs) { $users = $web.Users $web.Name foreach($user in $users) { " " + $user.Name + " , " + $user.Roles } } ## export by group #$groups = $site.RootWeb.sitegroups #foreach ($mygroup in $groups) #{ # "Group: " + $mygroup.name; # foreach ($user in $mygroup.users) # { # " User: " + $user.name # } #} $site.Dispose()