【问题标题】:Get programmatically User Roles and Permissions in SSRS 2008在 SSRS 2008 中以编程方式获取用户角色和权限
【发布时间】:2015-11-11 23:40:39
【问题描述】:

我在 Windows 2008 R2 上使用 SSRS 2008。

如何使用 Powershell 或 C#以编程方式)获取角色和权限的用户列表(报表管理器角​​色,例如 Browser, Content Manager 等)? p>

有什么建议吗?

注意事项:

“文件夹设置”区域,您可以在其中为用户指定角色 - “内容管理员”、“发布者”、“浏览器”、“报表生成器”和“我的报表”

SSRS 在 Web GUI 中提供 2 个安全/角色部分:文件夹设置和站点设置。

【问题讨论】:

标签: security powershell reporting-services scripting ssrs-2008


【解决方案1】:

我尝试使用我的脚本 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;

【讨论】:

    猜你喜欢
    • 2019-07-18
    • 2013-04-25
    • 1970-01-01
    • 2014-07-03
    • 1970-01-01
    • 2021-05-29
    • 1970-01-01
    • 2014-06-02
    • 2010-10-25
    相关资源
    最近更新 更多