SharePoint 2010: elencare gli utenti di un sito che hanno i permessi Full Control/Owners con uno script Powershell Script (it-IT)

SharePoint 2010: elencare gli utenti di un sito che hanno i permessi Full Control/Owners con uno script Powershell Script (it-IT)

SharePoint 2010

Il seguente script PowerShell può essere usato per elencare gli utenti che hanno il permesso Full Control nei siti.

$Output =@();
$Path = "";
#Using pipe separator since we have "," separating the Last Name and First Name
$Output += ("SiteCollectionID|WebSiteUrl|Scope|User|Email");
$WebUrl ="";
[System.Reflection.Assembly]::LoadWithPartialName("System");
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint");
#Web Application URL
$WebApplicationURL = "http://<WebAppUrl>";
#Enumerate through all Site Collections and Sites
Get-SPWebApplication -Identity $WebApplicationURL | Get-SPSite -limit all | Get-SPWeb -limit all|%{
$web = $_;
#Check if the site has unique permissions
if($web.HasUniqueRoleAssignments -eq "True" -and $web.IsRootWeb -eq "False"){
$WebUrl = $web.Url;
try{
#Enumerate through all Users in the Web
foreach($user in $web.Users){
$UserName = $user.Name;
#Check if user has Full Control Permissions
if($web.DoesUserHavePermissions($user,[Microsoft.SharePoint.SPBasePermissions]::FullMask)){
$Output += ($web.Site.ID.ToString() +"|"+$web.URL + "|Site|"  +$user.Name + "|" +$user.Email);
}
}
#Get Groups containing Owners in the Title and check for Full Mask Permissions
$OwnerGroups = $web.Groups| where {$_.Name -match “Owners” }
foreach($group in $OwnerGroups){
#$IsFullControlOwnerGroup = $group.Roles|where {$_.PermissionMask -eq "FullMask"}
#if($IsFullControlOwnerGroup.Count -gt "0"){
foreach($user in $group.Users){
$Output += ($web.Site.ID.ToString()+"|"+$web.URL + "|" + $group.Name + "|" + $user.Name + "|" + $user.Email);}
#}
}
$IsFullControlOwnerGroup =$null;
$web.Dispose();
}
catch [System.Exception]{
Write-Host ($WebUrl + ":" + $_.Exception.Message + ":" + $_.Exception.StackTrace);
}
}
}
$Output > ($Path + "\SiteOwners.csv")


Altre lingue

Questo articolo è disponibile anche nelle seguenti lingue:

English (en-US)

Leave a Comment
  • Please add 1 and 8 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Luigi Bruno edited Revision 1. Comment: Added the "Italian Wiki Articles" tag to the tag list.

  • Luigi Bruno edited Original. Comment: Added the "Altre lingue" section. Edited tags list.

Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Luigi Bruno edited Original. Comment: Added the "Altre lingue" section. Edited tags list.

  • Luigi Bruno edited Revision 1. Comment: Added the "Italian Wiki Articles" tag to the tag list.

Page 1 of 1 (2 items)