I know this is a few years old now, but there is in my opinion a better solution. You can use PowerShell to run any SSRS report, including the SCCM reports.
There is a good general discussion on this topic here: https://sqlbelle.wordpress.com/2015/08/17/automate-ssrs-report-generation-using-powershell/
Below is a working example. Note that the Microsoft report viewer is a prerequisite, and the below code presumes that you have the needed packages in c:\temp\SQLReportViewer, and of course insert your SSRS servername and the correct path to the report you want to run:
$username = 'someuser'
Write-Progress -Activity "Progress searching for $username" -status "Getting 'logged on user' report from SCCM"
Try
{
$version, $key = (Get-ChildItem C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms -ErrorAction Stop | Sort-Object name)[-1].Name -split '__'
Add-Type -AssemblyName "Microsoft.ReportViewer.WinForms, Version=$version, Culture=neutral, PublicKeyToken=$key" -ErrorAction Stop
}
Catch
{
Write-Warning "`nFailed to load the required Microsoft ReportViewer Assembly"
Write-Warning 'Installing Microsoft Report Viewer 2015...'
#$install = Read-Host 'Install Microsoft Report Viewer 2015 (y/n)'
#if ($install -like "n*") { return }
msiexec.exe /passive /norestart /i c:\temp\SQLReportViewer\2015\SQLSysClrTypes.msi | Out-Null
msiexec.exe /passive /norestart /i c:\temp\SQLReportViewer\2015\ReportViewer.msi | Out-Null
Try
{
$version, $key = (Get-ChildItem C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms -ErrorAction Stop | Sort-Object name)[-1].Name -split '__'
Add-Type -AssemblyName "Microsoft.ReportViewer.WinForms, Version=$version, Culture=neutral, PublicKeyToken=$key" -ErrorAction Stop
}
Catch { Write-Error 'Still failed to load the required Microsoft ReportViewer Assembly'; Return }
}
$reportViewer = New-Object Microsoft.Reporting.WinForms.ReportViewer
$reportViewer.ProcessingMode = "Remote"
$reportViewer.ServerReport.ReportServerUrl = "http://<ssrs server>/reportserver"
$reportViewer.ServerReport.ReportPath = "/Useful Reports/Master User List/Logon User report"
$inputParams = @{
username = "%\$username"
}
#create an array based on how many incoming parameters
$params = New-Object 'Microsoft.Reporting.WinForms.ReportParameter[]' $inputParams.Count
$i = 0
ForEach ($p In $inputParams.GetEnumerator())
{
$params[$i] = New-Object Microsoft.Reporting.WinForms.ReportParameter($p.Name, $p.Value, $false)
$i++
}
$reportViewer.ServerReport.SetParameters($params)
#required variables for rendering
$mimeType = $null
$encoding = $null
$extension = $null
$streamids = $null
$warnings = $null
#export to Excel
Try
{
$bytes = $reportViewer.ServerReport.Render("CSV", $null,
[ref]$mimeType,
[ref]$encoding,
[ref]$extension,
[ref]$streamids,
[ref]$warnings)
}
Catch
{
'Failed to run the required SCCM report.'
Return
}
$csv = [System.Text.Encoding]::UTF8.GetString($bytes) -split '\n'
#region start after first blank line which is where the column headers are defined
$i = 0
ForEach ($line In $csv)
{
If ($line.trim() -eq "") { Break }
Else { $i++ }
}
$csv = $csv[($i + 1) .. $csv.count]
#endregion start after first blank line
$sessionsFromSCCM = ConvertFrom-Csv $csv
$sessionsFromSCCM