Skip to content

Instantly share code, notes, and snippets.

@mvillegascuellar
Created September 13, 2018 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mvillegascuellar/59c5cb176dd9816b9c9114fb04b00147 to your computer and use it in GitHub Desktop.
Save mvillegascuellar/59c5cb176dd9816b9c9114fb04b00147 to your computer and use it in GitHub Desktop.
# 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