Create a ScheduleDefinition object in Powershell

北慕城南 提交于 2019-12-11 02:59:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!