在 SSRS 2008 中以编程方式获取用户角色和权限
Get programmatically User Roles and Permissions in SSRS 2008
我在 Windows 2008 R2 上使用 SSRS 2008。
如何使用 Powershell 或 C# (以编程方式)?
有什么建议吗?
备注:
"Folder Settings" 可以为用户指定角色的区域 - "Content Manager," "Publisher," "Browser," "Report Builder," 和 "My Reports"
SSRS 在 Web GUI 中有 2 个 security/role 部分可用:文件夹设置和站点设置。
我尝试使用我的脚本 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;
我在 Windows 2008 R2 上使用 SSRS 2008。
如何使用 Powershell 或 C# (以编程方式)?
有什么建议吗?
备注:
"Folder Settings" 可以为用户指定角色的区域 - "Content Manager," "Publisher," "Browser," "Report Builder," 和 "My Reports"
SSRS 在 Web GUI 中有 2 个 security/role 部分可用:文件夹设置和站点设置。
我尝试使用我的脚本 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;