security - 以编程方式获取 SSRS 2008 中的用户角色和权限

标签 security powershell reporting-services scripting ssrs-2008

我在 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/

相关文章:

security - Grails 中的真实性 token

security - Grails 密码更改 : Allow only "new" passwords

powershell - 有什么方法可以在指定时间过滤所有文件吗?

asp.net - 如何使用 ReportService2010 命名空间呈现报表

php - Codeigniter - 检查用户是否登录并存在(这是一个真实的用户)

php - 使用 PHP + Curl 固定 TLS 公钥?

visual-studio - 自动添加 Visual Studio "External Tools..."菜单选项的 PowerShell 脚本?

datetime - PowerShell 中的 "Group by day"

sql-server-2008 - SSRS 报告需要比查询更长的时间;尝试参数嗅探和 nolock 修复

sql-server-2008 - 无法解决排序规则冲突