我在Windows 2008 R2上使用SSRS 2008。
如何使用 Powershell或C#(以编程方式)获取角色和权限的用户列表(报告管理器角色,如Browser, Content Manager
等)?
有什么建议吗?
注意:
"文件夹设置"您可以为用户指定角色的区域 - " Content Manager," "出版者" "浏览器," "报告生成器,"和#34;我的报告"
SSRS在Web GUI中提供了2个安全/角色部分:文件夹设置和站点设置。
答案 0 :(得分:3)
我尝试使用我的脚本powershell。
参考文献:http://www.bi-rootdata.com/2015/03/list-ssrs-items-permissions-using.html Anup Agrawal评论
用法:
$ScriptDirectory = Split-Path $MyInvocation.MyCommand.Path
Clear-Host
Write-Host $ScriptDirectory
Write-Host $env:COMPUTERNAME -ForegroundColor Yellow
Write-Host $env:USERNAME -ForegroundColor Yellow
$ReportServerUri = 'http://localhost/ReportServer/ReportService2005.asmx'
$InheritParent = $true
$SourceFolderPath = '/'
$outSSRSSecurity=@()
$Proxy = New-WebServiceProxy -Uri $ReportServerUri -Namespace SSRS.ReportingService2005 -UseDefaultCredential
$items = $Proxy.ListChildren($sourceFolderPath, $true)|Select-Object Type, Path, Name|Where-Object {$_.type -eq "Folder"};
foreach($item in $items)
{
#Write-Host $item
if ($item.Name -ne "TestsCustomCDR")
{
#continue;
}
Write-Host $item.Path -ForegroundColor Yellow
Write-Host $item.Name -ForegroundColor Green
Add-Member -InputObject $item -MemberType NoteProperty -Name PolicyGroupUserName -Value '';
foreach($policy in $Proxy.GetPolicies($item.path, [ref]$InheritParent))
{
Write-Host $policy.GroupUserName
$objtemp=$item.PsObject.Copy();
$objtemp.PolicyGroupUserName=$policy.GroupUserName;
$outSSRSSecurity += $objtemp;
$objtemp.reset;
}
}
$outSSRSSecurity|Export-csv SSRSSecurityOutput.csv -NoTypeInformation;