

New-Item -ItemType Directory -Path $downloadFolderSub -Force > $null

# Create download folder if it doesn't exist (concatenate: "c:\temp\ssrs\" and "/SSRSFolder/") Write-Host "Downloading $($ssrsItem.Path)$($extension)"

# Write path to screen for debug purposes # Determine extension for Reports and DataSources $ssrsItems = $ssrsProxy.ListChildren("/", $true) | Where-Object # List everything on the Report Server, recursively, but filter to keep Reports and DataSources $ssrsProxy = New-WebServiceProxy -Uri "$($ssrsServer)/ReportServer/ReportService2010.asmx?WSDL" -UseDefaultCredential #$ssrsProxy = New-WebServiceProxy -Uri "$($ssrsServer)/ReportServer/ReportService2010.asmx?WSDL" -Credential $mycreds #$mycreds = New-Object ("MyUser", $secpasswd) #$secpasswd = ConvertTo-SecureString "MyPassword!" -AsPlainText -Force # structure in the local download folder. # Download Reports and DataSources from a SSRS server and create the same folder In case the link breaks, here's the code from the link: # Nothing to install, just added my url, and pasted into Powershell. Remove-Item -LiteralPath $tempfolder -Force -Recurseįound and used this without any issues. ::CreateFromDirectory($tempfolder, $zipfile) Set-Content -Path ($filename) -Value $xmldata -Force $filename = $tempfolder + $report.Replace('/', '\') + $report $cmd.CommandText = "SELECT CAST(CAST(Content AS VARBINARY(MAX)) AS XML) FROM Catalog WHERE ItemID = '" + $report + "'" $allreports.CommandText = "SELECT ItemID, Path, CASE WHEN Type = 2 THEN '.rdl' ELSE '.rds' END AS Ext FROM Catalog WHERE Type IN(2,5)" $allreports = $connection.CreateCommand() $connection.ConnectionString = $connectionString $zipfile = $PSScriptRoot + '\reports.zip' $connectionString = "Server=$dataSource uid=$user pwd=$pass Database=$database Integrated Security=False " Add-Type -AssemblyName "System.IO.Compression.Filesystem" You have to provide the SQL server database details. I've created this powershell script to copy them into a ZIP.
