Hello,I am trying to automate the initialization of the Report Server in SSRS Configuration Manager using Powershell.So far I have worked out that I can use the InitializeReportServer Method which requires the InstallationID as a parameter. This can be found in the rsreportserver.config XML file and appears like this..<InstallationID>{d63c8ae2-003e-4f3e-bdae-faa7688b7a79}</InstallationID>...so I retrieve it using this...$XML=[XML](Get-Content 'C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config')$InstID = $XML.DocumentElement | Select InstallationID$SSRSConMgr = Get-WmiObject -Namespace "root\Microsoft\SqlServer\ReportServer\RS_MSSQLSERVER\v11\Admin" -Class MSReportServer_ConfigurationSetting -ComputerName $env:COMPUTERNAME$SSRSConMgr.InitializeReportServer([string]$InstID)...however, it returns the result with the curly braces included, so I get an error when I try to use the variable as a parameter...__GENUS : 2__CLASS : __PARAMETERS__SUPERCLASS : __DYNASTY : __PARAMETERS__RELPATH : __PROPERTY_COUNT : 2__DERIVATION : {}__SERVER : __NAMESPACE : __PATH : ExtendedErrors : {The parameter value provided for 'InstallationID' does not match the parameter type. (rsParameterTypeMismatch), Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).}HRESULT : -2146233088PSComputerName : ...so my questions is, how do I return the result, but exclude the curly braces?Any help, is as always, greatly appreciated.Kind regards,D.
↧