我想将SSRS数据源凭据检索从使用以下凭据更改为没有任何Powershell和脚本失败的凭据。
我想根据本文将值“ Store”更改为“ None”: https://docs.microsoft.com/en-us/dotnet/api/reportservice2010.credentialretrievalenum?view=sqlserver-2016#ReportService2010_CredentialRetrievalEnum_None
这是我的代码:
$uri ='http://ServerName/ReportServer/ReportService2010.asmx?wsdl'
$reporting = New-WebServiceProxy -uri $uri -UseDefaultCredential -namespace "ReportingWebService"
$DataSources = $reporting.ListChildren('/',$true) | Where-Object {$_.Name -eq "DataSourceName"}
foreach($Object in $DataSources) {
$dataSource =$reporting.GetDataSourceContents($Object.path)
#$dataSource.CredentialRetrieval="None"
$dataSource.CredentialRetrieval=[ReportingWebService.CredentialRetrievalEnum]::None
$reporting.SetDataSourceContents($Object.path,$dataSource)
}
这是错误:
使用“ 2”作为参数调用“ SetDataSourceContents”的异常:“ username和CredentialRetrieval字段的值组合无效。---> microsoft.ReportingServices.Diagnostics.Utilities.InvalidElementCombinationException:username和CredentialRetrieval字段的值组合无效。” 在线:13字符:4 + $ reporting.SetDataSourceContents($ Object.path,$ dataSource) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ + CategoryInfo:未指定:(:) [],MethodinvocationException + FullyQualifiedErrorId:SoapException