Created
September 13, 2018 18:24
-
-
Save mvillegascuellar/59c5cb176dd9816b9c9114fb04b00147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Declaro algunas variables | |
$NuevoDS = '/NuevaCarpeta/Data Sources/Default' | |
$rsuri = 'http://MiServidorSSRS/ReportServer' | |
$NuevaCarpetaSSRS = '/NuevaCarpeta' | |
# Obtengo los reportes de la Nueva carpeta SSRS | |
$reports = Get-RsFolderContent -ReportServerUri $rsuri -RsFolder $NuevaCarpetaSSRS | Where-Object TypeName -EQ 'Report' | |
# Cambio el Datasource que tiene por el nuevo DS | |
$reports | ForEach-Object { | |
# Obtengo el antiguo DS por cada reporte | |
$oldds = Get-RsItemDataSource -RsItem $_.Path -ReportServerUri $rsuri | Select-Object -ExpandProperty Name; | |
# Actualizo el DS del reporte | |
Set-RsDataSourceReference -Path $_.Path -DataSourceName $oldds -DataSourcePath $NuevoDS -ReportServerUri $rsuri ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment