Randypaulo.files.wordpress.com



<#.SYNOPSISUninstalls an RDL file from SQL Reporting Server using Web Service.DESCRIPTIONUninstalls an RDL file from SQL Reporting Server using Web Service.NOTESFile Name: Uninstall-SSRSRDL.ps1Author: Randy Aldrich PauloPrerequisite: SSRS 2008, Powershell 2.0.EXAMPLEUninstall-SSRSRDL -webServiceUrl "http://[ServerName]/ReportServer/ReportService2005.asmx?WSDL" -path "MyReport".EXAMPLEUninstall-SSRSRDL -webServiceUrl "http://[ServerName]/ReportServer/ReportService2005.asmx?WSDL" -path "Reports/Report1"#>function Uninstall-SSRSRDL([Parameter(Position=0,Mandatory=$true)][Alias("url")][string]$webServiceUrl,[Parameter(Position=1,Mandatory=$true)][Alias("path")][string]$reportPath){#Create ProxyWrite-Host "[Uninstall-SSRSRDL()] Creating Proxy, connecting to : $webServiceUrl"$ssrsProxy = New-WebServiceProxy -Uri $webServiceUrl -UseDefaultCredential#Set Report Folderif(!$reportPath.StartsWith("/")) { $reportPath = "/" + $reportPath }try{Write-Host "[Uninstall-SSRSRDL()] Deleting: $reportPath"#Call Proxy to upload report$ssrsProxy.DeleteItem($reportPath)Write-Host "[Uninstall-SSRSRDL()] Delete Success." }catch [System.Web.Services.Protocols.SoapException]{$msg = "[Uninstall-SSRSRDL()] Error while deleting report : '{0}', Message: '{1}'" -f $reportPath, $_.Exception.Detail.InnerTextWrite-Error $msg}} ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download