Exporting content

There are really two core aspects to working with data in Reporting Services: exporting and importing content. There are better tools out there for authoring reports. Where automation – and thus PowerShell – really shines, however, is moving SSRS data from one SQL instance to another; thus, exporting and importing content really is the bread and butter of this module, and there are solid commands out here to facilitate just this.

On the export side, the two important commands are Out-RsCatalogItem (for individual or filtered items) and Out-RsFolderContent (for bulk export):

# Export /Foo/Example to the current path
Out-RsCatalogItem -RsItem /Foo/Example -Destination .

# Export all Data Sources in /Foo
Get-RsFolderContent -RsFolder "/Foo" |
Where-Object TypeName -eq DataSource |
Select-Object -ExpandProperty Path |
Out-RsCatalogItem -Destination .

# Export all items that were created in the last 7 days
Get-RsFolderContent -RsFolder "/" -Recurse |
Where-Object { ($_.CreationDate -gt (Get-Date).AddDays(-7)) -and ($_.TypeName -ne "Folder") } |
Select-Object -ExpandProperty Path |
Out-RsCatalogItem -Destination .

# Export all content in the SSRS data store
Out-RsFolderContent -RsFolder "/" -Recurse -Destination .
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset