问题
I already have a powershell script that imports reports into SSRS with powershell using the ReportService2010.asmx?wsdl API.
I have issues with creating the cache options however, in particular to create a simple schedule. The code example on the MSDN does not have a powershell example.
http://technet.microsoft.com/en-us/library/reportservice2010.reportingservice2010.createcacherefreshplan.aspx
I was hoping someone could help me how to write this example in powershell? In particular how to create a ScheduleDefinition object.
回答1:
It seems the trick is to assign a namespace and class on your New-WebServiceProxy I had this line in my code:
$RS = New-WebServiceProxy -Uri $reportServerURI -UseDefaultCredential
Now I have changed it to this:
$RS = New-WebServiceProxy -Class 'RS' -Namespace 'RS' -Uri $reportServerURI -UseDefaultCredential
This allows me to create the ScheduleDefinition object via
$definition New-Object RS.ScheduleDefinition
来源:https://stackoverflow.com/questions/22889225/create-a-scheduledefinition-object-in-powershell