{"id":9688,"date":"2026-05-23T09:46:20","date_gmt":"2026-05-23T09:46:20","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=9688"},"modified":"2026-05-23T09:46:21","modified_gmt":"2026-05-23T09:46:21","slug":"certify-the-web-script-to-update-sql-reporting-services","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/certify-the-web-script-to-update-sql-reporting-services","title":{"rendered":"Certify the Web Script to Update SQL Reporting Services"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code class=\"\"># Certify the Web passes $result automatically - no cert lookup needed\n$thumbprint = $result.ManagedItem.CertificateThumbprint.ToLower()\n\n\n\n\n$ssrsServerName = (Get-WmiObject -namespace root\\Microsoft\\SqlServer\\ReportServer -class __Namespace | \n    Select-Object -First 1).Name\n\n$wmiName = (Get-WmiObject -namespace root\\Microsoft\\SqlServer\\ReportServer -Filter \"Name='$ssrsServerName'\" -class __Namespace).Name\n$version = (Get-WmiObject -namespace root\\Microsoft\\SqlServer\\ReportServer\\$wmiName -class __Namespace).Name\n$rsConfig = Get-WmiObject -namespace \"root\\Microsoft\\SqlServer\\ReportServer\\$wmiName\\$version\\Admin\" -class MSReportServer_ConfigurationSetting\n\n$applications = @('ReportServerWebApp', 'ReportManager', 'ReportServerWebService')\n\n$bindings = $rsConfig.ListSSLCertificateBindings(1033)\n$httpsPort = 443\n$ipAddress = \"0.0.0.0\"\n\n# Read port from existing IPv4 binding if present\nif ($bindings -and $bindings.Application) {\n    for ($i = 0; $i -lt $bindings.Application.Count; $i++) {\n        if ($bindings.Application[$i] -eq 'ReportServerWebService' -and $bindings.IPAddress[$i] -eq '0.0.0.0') {\n            $httpsPort = $bindings.Port[$i]\n        }\n    }\n\n    # Remove only IPv4 bindings for our target applications\n    $allThumbs = $bindings.CertificateHash | Where-Object { $_ } | Select-Object -Unique\n    foreach ($thumb in $allThumbs) {\n        foreach ($app in $applications) {\n            $rsConfig.RemoveSSLCertificateBindings($app, $thumb, $ipAddress, $httpsPort, 1033) | Out-Null\n        }\n    }\n}\n\n# Bind new cert to IPv4 only\nforeach ($app in $applications) {\n    $r = $rsConfig.CreateSSLCertificateBinding($app, $thumbprint, $ipAddress, $httpsPort, 1033)\n    if ($r.HRESULT -ne 0) { throw \"Failed to bind $app : HRESULT $($r.HRESULT)\" }\n}\n\nWrite-Host \"SSRS SSL certificate updated successfully.\"<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9688","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=9688"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9688\/revisions"}],"predecessor-version":[{"id":9689,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9688\/revisions\/9689"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=9688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=9688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=9688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}