question

alex1372 avatar image
alex1372 asked

Update description field of shared SSRS datasource with powershell

I have a working script that updates connection string of shared SSRS datasource from one server to another for maintenance events.

The only thing I can't figure out is how to updated and save Description filed? It's needed for easy identification of datasources that were moved to standby servers


ssrs-description-field.png


$URI = New-Object System.Uri('http://localhost/ReportServer/ReportService2010.asmx?wsdl')
$SSRS = New-WebServiceProxy -Uri $URI -UseDefaultCredential
$DataSource = ($SSRS.ListChildren("/data sources", $true)) | Where-Object {$_.Path -eq "/Data Sources/WebReports"}

$SRC = 'Primary Mode Server' 
$DataSource.Description = "Datasource points to $SRC"


$DS = $SSRS.GetDataSourceContents($DataSource.Path)
                
$DS.ConnectString = $DS.ConnectString.Replace('Standby Mode Server',$SRC)
$DS.UserName = "newusername"
$DS.Password = "newuserpassword"

$SSRS.SetDataSourceContents($DataSource.Path,$DS)
ssrspowershellsql2014datasource
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.