Powershell script

Hi,

I would like to export list of users to  a csv File who have permissions to a particular library. I would like to display loginname, display name, and the permissions the user has on the library.

Can anyone help me with a powershell script to export this data?

March 25th, 2015 1:12am

Hi Techie

This should help you

Add-PSSnapin Microsoft.SharePoint.PowerShell
$WebUrl = Read-Host 'Please input URL address of target web'
$Web = Get-SPWeb $WebUrl
$ListName = Read-Host 'Please input list name'
$List = $web.Lists[$ListName]
$Unique = $List.hasuniqueroleassignments 
if (($List.permissions -ne $null) -and ($Unique -eq "True")) 
{
Write-Output "---------------------"
Write-Output "List permission is: "
$List.permissions | fl member, basepermissions 
}
elseif ($Unique -ne "True") { 
Write-Output "Inherits permissions from $Web" 
} 
Write-Host "----------------------" 
$web.dispose() 

Free Windows Admin Tool Kit Click here and download it now
March 25th, 2015 1:43am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics