Monday, October 17, 2016

PowerShell Script to List All Users who have access into document library in SharePoint site


Add-PSSnapin "Microsoft.SharePoint.PowerShell"

$web = Get-SPWeb -Identity https://bw.bytes.co.za/applications/

$list = $web.Lists[“Client Billing”]
$siteCollUsers = $web.SiteUsers

$filename = "E:\Applications\application_usersxyz1.csv"

foreach($MyUser in $siteCollUsers)
{
#Write-Host ” ————————————- ”
#Write-Host “Site Collection URL:”, $SiteCollectionURL
if($list.DoesUserHavePermissions([Microsoft.SharePoint.SPBasePermissions]::ViewListItems,$MyUser) -eq $true)
{
#Write-Host “User : “, $MyUser.LoginName
#Write-Host “Assigned Permissions : “, $list.GetUserEffectivePermissions($MyUser.LoginName)

 "User:" + $MyUser.UserLogin +"     "+ "User Name: " +$MyUser.name + "     " + "Email: " +$MyUser.Email  | Out-File $filename -Append


}
#Write-Host ” ————————————- ”
}

1 comment:

  1. Bila membahas asyiknya permainan kartu online ini memang tiada batas. Namun ketahuilah kalau kamu akan selalu mendapatkan hal baru yang sebelumnya kamu tidak ketahui dari Permainan Judi Online Terpercaya. Dan dari sanalah istilah "konklusi" dimulai pada game (Baca Selengkapnya...)

    ReplyDelete