我在 Windows 2008 R2 上使用 SSRS 2008。
如何使用 Powershell 或 C# 获取角色和权限的用户列表(报表管理器角色,例如浏览器、内容管理员等)(以编程方式)?
有什么建议吗?
注释:
“文件夹设置”区域,您可以在其中指定用户角色 - “内容管理员”、“发布者”、“浏览器”、“报表生成器”和“我的报表”
SSRS 在 Web GUI 中提供 2 个安全/角色部分:文件夹设置和站点设置。
最佳答案
我尝试使用我的脚本 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;
关于security - 以编程方式获取 SSRS 2008 中的用户角色和权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32082516/