Hi All,
How to get the all site collections and their owners,member,permissions through powershell .
Thanks,
Advance.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Thuyavan GanesanPosted Dec 6, 2018, 2:44 PM
Hi Chinna,
Please see if this script works for you.
$webapp = Get-SPWebApplication “your SPsite.com
$sites = $webapp | Get-SPSite -Limit All
$webs = $sites | Get-SPWeb -Limit All
foreach ($web in $webs) {
$users = $web.siteusers
write-host "Processing " $web.url -foregroundcolor cyan
write-host "Site Admins:" -foregroundcolor yellow
foreach ($user in $users) {
if ($user.IsSiteAdmin) {
write-host $user.Name
}
#write-host $user.Name "IstSiteAdmin: " $user.isSiteAdmin
}
Write-host "Site Owners" -foregroundcolor green
foreach ($user in $users) {
if ($web.DoesUserHavePermissions($user,[Microsoft.SharePoint.SPBasePermissions]::FullMask)) {
write-host $user.Name
}
}
}
Please let me know if that works
Thuyavan