I have made the following script from google for backing up the SSRS Encryption keys:
$pwd = "sa@123@123"
$SSRSClass = Get-Wmiobject -namespace "root\microsoft\sqlserver\reportserver\rs_BPSSRS\v10\admin" -class "MSReportServer_ConfigurationSetting"
$key = $SSRSClass.BackupEncryptionKey($pwd)
$stream = [System.IO.File]::Create("c:\\SSRS.snk", $key.KeyFile.Length)
$stream.Write($key.KeyFile, 0, $key.KeyFile.Length)
But I'm getting the following errors:
Method invocation failed because [System.Object] doesn't contain a method named 'BackupEn
At line:5 char:38
+ $key = $SSRSClass.BackupEncryptionKey <<<< ($results)
+ CategoryInfo : InvalidOperation: (BackupEncryptionKey:String) , RuntimeEx
+ FullyQualifiedErrorId : MethodNotFound
The above code is working for the servers where there is only one named instance of SSRS is running. The above mentioned error is only thrown for servers where there are atleast two named instances are running. kindly look into this and suggest an edit asap.