Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Trouble using powershell with getSubscriptionProperties method fails because I can't create an ExtensionSettings object

$
0
0

I'm trying to use the GetSubscriptionProperties function of the ReportingService2010 library using powershell on a 2008r2 reporting service. Here's what I have written:

$serverInfo = "/reportservice2010.asmx"
$sourceUri = "http://rserver/reportserver" + $serverInfo

$sourceProx = New-WebServiceProxy -Uri $sourceUri -UseDefaultCredential

$extensionSettings = [ref]
$description = [ref]
$active = [ref]
$status = [ref]
$eventType = [ref]
$matchdata = [ref]
$parameters = [ref]

$sourceProx.GetSubscriptionProperties("DBF920D4-81FC-47D7-B738-20A6E9A90DD9", `
                                        [ref]$extensionSettings, `
                                        [ref]$description, `
                                        [ref]$active, `
                                        [ref]$status, `
                                        [ref]$eventType, `
                                        [ref]$matchdata, `
                                        [ref]$parameters )

When running that, I get this error: 

Exception calling "GetSubscriptionProperties" with "8" argument(s): "Cannot convert the "System.Management.Automation.PSReference" value of type "System.RuntimeType" to type "Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy47tserver_reportservice2010_asmx.ExtensionSettings"."
At C:\Users\joe\Documents\programs\migrate-sub.ps1:22 char:1+ $sourceProx.GetSubscriptionProperties("DBF920D4-81FC-47D7-B738-20A6E9A90DD9", `+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId : PSInvalidCastException

I'm fairly certain that I need to declare $extensionSettings as an ExtensionSettings object and construct the object. How do I do this? I've tried:

$extensionSettings = new-object -Typename ReportingService2010.ExtensionSettings 

It complains that I need to load the assembly because it doesn't know what an ExtensionSettings object is. $sourceProx doesn't have a method for creating an ExtensionSettings object, and the assembly ReportService2010.dll isn't downloadable. What can I do?



Viewing all articles
Browse latest Browse all 10045

Trending Articles