- PowerShell 100%
| .gitattributes | ||
| AGENT-README.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| Deploy-SsrsFolderItems.ps1 | ||
| Download-SsrsFolderItems.ps1 | ||
| LICENSE | ||
| README.md | ||
| Remove-SsrsFolderItems.ps1 | ||
| SECURITY.md | ||
ssrs-tools
PowerShell utilities for administering SQL Server Reporting Services (SSRS) 2016+ and Power BI Report Server through the REST API v2.0.
Scripts
| Script | Purpose |
|---|---|
Remove-SsrsFolderItems.ps1 |
Removes all Reports and Datasets from a single SSRS folder, after showing the connected site, the folder, and the full list of items to be removed, and requiring a typed confirmation. |
Deploy-SsrsFolderItems.ps1 |
Deploys all Reports and Datasets from a local folder into a single SSRS folder (the complement of the removal script), with the same site/folder/item preview and typed confirmation. |
Download-SsrsFolderItems.ps1 |
Downloads all Reports and Datasets from a single SSRS folder to a local directory (the reverse of the deploy script), with the same site/folder/item preview and typed confirmation. |
Prerequisites
- Windows PowerShell 5.1 or PowerShell 7+.
- Network access to the target SSRS web portal (for example
https://reports.example.com/reports). - An account with permission to read and delete catalog items in the target folder. The scripts authenticate with the current Windows identity by default, or with an explicit
-Credential.
Remove-SsrsFolderItems.ps1
Removes the Reports and Datasets (not Data Sources) directly inside one folder. The operation is not recursive.
# Dry run - show the site, folder, and every item that WOULD be removed:
.\Remove-SsrsFolderItems.ps1 `
-PortalUrl https://reports.example.com/reports `
-FolderPath /MyReportsFolder `
-WhatIf
# Real run - preview, then a typed folder-name confirmation, then delete:
.\Remove-SsrsFolderItems.ps1 `
-PortalUrl https://reports.example.com/reports `
-FolderPath /MyReportsFolder
Key parameters:
| Parameter | Description |
|---|---|
-PortalUrl |
SSRS web portal base URL (do not include /api/v2.0; it is appended automatically). |
-FolderPath |
Catalog folder whose items are removed, for example /MyReportsFolder. |
-Type |
Catalog item types to remove. Defaults to Report and DataSet. Add DataSource only if you really mean to remove data sources. |
-Credential |
Optional PSCredential. When omitted, the current Windows identity is used. |
-Force |
Skip the typed confirmation (for automation). Deletion still honours -WhatIf. |
The script prints the connected site and host, the target folder, and the full item list before doing anything, and cancels unless you type the folder name exactly (or pass -Force). It also supports -WhatIf and -Confirm.
Deletions cannot be undone from the script. Re-deploy from source (Visual Studio or your release pipeline) to restore removed items.
Deploy-SsrsFolderItems.ps1
Deploys the Reports (.rdl) and Datasets (.rsd) from a local folder into one SSRS folder. Datasets are uploaded before Reports so a report's shared-dataset references resolve. The target folder (and any missing parents) is created if needed. Existing items are replaced only with -Overwrite; Data Sources (.rds) are not handled (existing ones in the target folder are left in place for reports/datasets to bind to).
# Dry run - show the site, target folder, source path, and what WOULD deploy:
.\Deploy-SsrsFolderItems.ps1 `
-PortalUrl https://reports.example.com/reports `
-FolderPath /MyReportsFolder `
-SourcePath C:\Dev\MyReportProject `
-WhatIf
# Real run - preview, typed confirmation, then upload (replacing existing items):
.\Deploy-SsrsFolderItems.ps1 `
-PortalUrl https://reports.example.com/reports `
-FolderPath /MyReportsFolder `
-SourcePath C:\Dev\MyReportProject `
-Overwrite
Key parameters:
| Parameter | Description |
|---|---|
-PortalUrl |
SSRS web portal base URL (no /api/v2.0). |
-FolderPath |
Target catalog folder to deploy into, for example /MyReportsFolder. |
-SourcePath |
Local directory containing the .rdl / .rsd files. |
-Type |
Catalog item types to deploy. Defaults to Report and DataSet. |
-Overwrite |
Replace items that already exist (otherwise they are skipped). |
-Credential |
Optional PSCredential. When omitted, the current Windows identity is used. |
-Force |
Skip the typed confirmation. Deployment still honours -WhatIf. |
Download-SsrsFolderItems.ps1
Downloads the Reports (.rdl) and Datasets (.rsd) from one SSRS folder to a local directory (the reverse of the deploy script). Files are written with their exact server bytes (BOM preserved). Existing local files are replaced only with -Force; Data Sources (.rds) are not downloaded.
# Dry run - show the site, source folder, destination, and what WOULD download:
.\Download-SsrsFolderItems.ps1 `
-PortalUrl https://reports.example.com/reports `
-FolderPath /MyReportsFolder `
-DestinationPath C:\Temp\MyReportsFolder `
-WhatIf
# Real run - preview, typed confirmation, then download (overwriting local files):
.\Download-SsrsFolderItems.ps1 `
-PortalUrl https://reports.example.com/reports `
-FolderPath /MyReportsFolder `
-DestinationPath C:\Temp\MyReportsFolder `
-Force
Key parameters:
| Parameter | Description |
|---|---|
-PortalUrl |
SSRS web portal base URL (no /api/v2.0). |
-FolderPath |
Source catalog folder to download from, for example /MyReportsFolder. |
-DestinationPath |
Local directory to write the files to (created if missing). |
-Type |
Catalog item types to download. Defaults to Report and DataSet. |
-Credential |
Optional PSCredential. When omitted, the current Windows identity is used. |
-Force |
Overwrite existing local files and skip the typed confirmation. Download still honours -WhatIf. |
Licence
Released under the MIT Licence.