{"id":16534,"date":"2021-07-16T12:06:05","date_gmt":"2021-07-16T10:06:05","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/"},"modified":"2021-07-16T12:06:05","modified_gmt":"2021-07-16T10:06:05","slug":"automate-restore-from-rubrik-with-powershell-part-2","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/","title":{"rendered":"Automate restore from Rubrik with PowerShell (part 2)"},"content":{"rendered":"<p>As promised during my last <a href=\"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell\/\">Rubrik blog post<\/a> I&#8217;m writing a second one to explain how to:<\/p>\n<ul>\n<li>log your different steps in a file<\/li>\n<li>add an integrity check after the restore<\/li>\n<li>and also improve my first scripting<\/li>\n<\/ul>\n<p>I will start by the end and improve my first scripts by creating functions for each step of the process.<br \/>\nWith Rubrik you can have multiple appliances (servers), it means that each server\/instance of you SQL Server environment will be dispatched on those servers and backup\/restore operations have to take place in the good Rubrik server.<br \/>\nTo connect to multiple Rubrik servers I created the Connect-dbiRubrik function:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">Function Connect-dbiRubrik(){\n\tparam(\n\t\t[Parameter(Mandatory=$true)]\n        $RubrikServer,\n\t\t[PSCredential]\n\t\t$Credential\n\t)\n    #Rubrik connection\n\tIf (-not $Credential){\n\t\t$Credential = Get-Credential;\n\t}\n\t\t$Connection = Connect-Rubrik -Server $RubrikServer -Credential $Credential;\n\n    return $Connection;\n}\n<\/pre>\n<p>This function will help us to find our protected databases on all Rubrik appliances.<br \/>\nTo get also the databases from Rubrik a new function has been created with, as mandatory parameter, an instance name and ,as optional parameters, a database name and a switch to add or not the system databases. This function will retrieve the instance databases part or not of an AlwaysOn Availability Group and fill a custom object to store some information about the database:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">function Get-dbiRubrikDatabase(){\n\tparam(\n\t\t[CmdletBinding()]\n\t\t[Parameter(Mandatory=$true)]\n\t\t[string[]]\n        $SqlInstance,\n\t\t[String]\n        $Database,\n        [switch]\n        $IncludeSystemDatabases\n\t)\n\t\n\t$DatabaseList = [System.Collections.ArrayList] @();\n\t\n\t@($SqlInstance) | Foreach-Object -Process {\n\t\t$ServerName = $_;\n\t\t## StandAlone databases\n\t\t$Command = 'Get-RubrikDatabase -ServerInstance $ServerName';\n\n\t\tIf ($Database){\n\t\t\t$Command += ' -Database $Database';\n\t\t}\n\n        If ($IncludeSystemDatabases) {\n            $Command += ' | Where-Object isrelic -eq $false';\n            }\n        Else {\n            $Command += ' | Where-Object {($_.isrelic -eq $false) -and ($_.name -notin (\"master\",\"msdb\",\"model\"))} '; \n            }\n\t\t\n\t\tWrite-Debug -Message \"Command to execute for StandAlone databases: $($Command)\";\n\t\t$StandAloneDatabases = Invoke-Expression -Command $Command;\n\t\t\n\t\t@($StandAloneDatabases) | Foreach-Object -Process { `\n\t\t\t$PSDatabase = [pscustomobject] @{\n\t\t\t\tServerName     \t= \"$($ServerName)\"\n\t\t\t\tDatabaseName   \t= \"$($_.Name)\"\n\t\t\t\tSLA \t\t\t= \"$($_.effectiveSlaDomainName)\"\n\t\t\t\tDatabaseID  \t= \"$($_.id)\"\n\t\t\t\tParentID  \t    = \"$($_.instanceId)\"\n\t\t\t\tRubrikServer    = \"$($rubrikConnection.Server)\"\n\t\t\t}; `\n\t\t\t$Null = $DatabaseList.Add($PSDatabase); `\n\t\t\t$PSDatabase = $Null; `\n\t\t};\n\t\t$StandAloneDatabases \t= $Null;\n\t\t$Command \t\t\t\t= $Null;\n\t\t\n\t\t$AAGs = Get-dbaAvailabilityGroup -SqlInstance $ServerName -WarningAction SilentlyContinue ;\n\n\n\t\tIf ($AAGs){\n\t\t\t@($AAgs) | Foreach-Object -Process {\n\n                $Command = 'Get-RubrikDatabase -AvailabilityGroupName $_.AvailabilityGroup';\n                \n                If ($Database){\n\t\t\t        $Command += ' -Database $Database';\n\t\t        } \n                $Command += ' | Where-Object isrelic -eq $false -WarningAction SilentlyContinue';\n                \n\t\t\t\t$AAGDatabases = Invoke-Expression -Command $Command;\n                $Command = $null;\n\n\t\t\t\t@($AAGDatabases) | Foreach-Object -Process { `\n\t\t\t\t\t$PSDatabase = [pscustomobject] @{\n\t\t\t\t\t\tServerName     \t= \"$($ServerName)\"\n\t\t\t\t\t\tDatabaseName   \t= \"$($_.Name)\"\n\t\t\t\t\t\tSLA \t\t\t= \"$($_.effectiveSlaDomainName)\"\n\t\t\t\t\t\tDatabaseID  \t= \"$($_.id)\"\n\t\t\t\t\t\tParentID  \t\t= \"$($_.availabilityGroupId)\"\n\t\t\t\t        RubrikServer    = \"$($rubrikConnection.Server)\"\n\t\t\t\t\t}; `\n\t\t\t\t\t$Null = $DatabaseList.Add($PSDatabase); `\n\t\t\t\t\t$PSDatabase = $Null; `\n\t\t\t\t};\n\t\t\t\t$AAGDatabases \t= $Null;\n\t\t\t};\n\t\t};\n\t\t\n\t\t$ServerName = $Null;\n\t};\n\t\t\n\treturn $DatabaseList;\n}\n<\/pre>\n<p>Now, to log the required information during our restore test we need to create a log file and to populate it. This log file will contain the instance name with current date and time.<br \/>\nA function to create such a file has been also created to remove for example the possible  in the instance name and to add the timestamp:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">function Convert-dbiInstanceToFileName(){\n\tparam(\n\t\t[Parameter(Mandatory=$true)]\n        $SqlInstance,\n\t\t[Parameter(Mandatory=$true)]\n        $Title\n\t)\n\t$SqlInstance_Str = $SqlInstance.Replace('','_');\n\treturn \"$($Title)_$($SqlInstance_Str)\" + '_' + (((Get-Date) -f 'yyyyMMddHHmmss') -replace 'D', '') + '.txt';\n}\n<\/pre>\n<p>Once the file name is generated we can create the file and write the desired information in it. The new function called Out-dbiLog will do that:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">function Out-dbiLog() {\nparam(\n[Parameter(Mandatory=$true)]\n[String] $Message,\n[Parameter(Mandatory=$true)]\n[String] $LogPath\n)\n\nIf (-not (Test-Path -Path $LogPath)) {\nTry{\n$Null = New-Item -Path $LogPath -ItemType 'file';\n\n'['+(Get-Date -f 'yyyy-MM-dd HH:mm:ss') +'] ' + $Message | Out-File -FilePath $LogPath -Append;\n}\ncatch {\nWrite-Host \"Function 'Out-dbiLog': cannot create file located at $($LogPath)\"  -ForegroundColor DarkRed -BackgroundColor Black;\n}\n}\nElse {\n'['+(Get-Date -f 'yyyy-MM-dd HH:mm:ss') +'] ' + $Message | Out-File -FilePath $LogPath -Append;\n}\n}\n<\/pre>\n<p>After the database is restored we can run an integrity check to be sure that the database is in a good shape. I will just use the <a href=\"https:\/\/docs.dbatools.io\/\">dbatools<\/a> cmdlet Invoke-dbaQuery with the switch -MessagesToOutput:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">Invoke-dbaQuery -SQLInstance $DestinationInstance -QueryTimeout 14400 -Database $destDBName -Query \"DBCC CHECKDB WITH NO_INFOMSGS\" -MessagesToOutput;\n<\/pre>\n<p>To finalize we can plan a scenario where we want to restore a complete production instance to a test instance, database by database to valid our backup solution, once done run an integrity check and after drop the restored database and log all those actions. Hereby the script to do that:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">$SourceInstance = 'ProdInst';\n$DestinationInstance = 'TestInst';\n[System.Collections.ArrayList] $statusList = @();\n\n$credential = Get-Credential;\n$RubrikServers = ('168.22.2.3','168.22.2.4');\n\n#LOG\n$LogFileName = Convert-dbiInstanceToFileName -SqlInstance $SourceInstance -Title 'Restore_Test';\n$LogPath = 'c:dbiTestRestore';\nOut-dbiLog -Message \"Test Restore from source instance $SourceInstance to destination instance $DestinationInstance \" -LogPath \"$LogPath$LogFileName\";\n\n#Retrieve all databases on both Rubrik servers\n$Dbs = @();\nforeach ($RubrikServer in $RubrikServers) {\n    $connect = Connect-dbiRubrik -RubrikServer $RubrikServer -Credential $credential;\n\n    $Dbs += Get-dbiRubrikDatabase -SqlInstance $SourceInstance;\n}\n\n#Remove the database with unprotected SLA \n$Dbs = $Dbs | Where-Object SLA -ne 'UNPROTECTED';\n\n#Restore the selected databases\nforeach ($Db in $Dbs) {\n    #LOG\n    Out-dbiLog -Message \"Start to restore database $($db.DatabaseName)\" -LogPath \"$LogPath$LogFileName\";\n\n    #Change database name on destination instance to visualize it quickly\n    $destDBName = 'Rest_' + $Db.DatabaseName;\n\n    #need to connect to the Rubrik server where the database is protected\n    $connect = Connect-dbiRubrik -rubrikserver $Db.RubrikServer -Credential $credential;\n\n    $Restore = Restore-dbiRubrikDatabase -Source $SourceInstance -Destination $DestinationInstance -DatabaseName $db.DatabaseName -NewDatabaseName $destDBName -TargetRestoreTime $date;\n\n    #Loop until restore is finished\n    $progress = 0;\n    $RestoreID = $Restore.ID\n    Do\n    {\n        #Search status of the restore\n        $status = (Get-RubrikRequest -id $RestoreID -Type 'mssql'); \n        Write-Debug $status.status;\n\n        #show a progress bar for the restore\n        If ($status.status -eq 'RUNNING') {\n            $progress = $status.progress; \n            }\n        else {\n            $progress = 100;\n        }\n        Write-Progress -Activity Restoring -Status $status.status -PercentComplete $progress -CurrentOperation \"Restore database $destDBName\"\n        \n        Start-Sleep -Seconds 1;\n    } Until ($status.status -in ('SUCCEEDED','FAILED'));\n\n    $null = $statusList.Add($status);\n\n    If ($status.status -eq 'SUCCEEDED') {\n        #LOG\n        Out-dbiLog -Message \"Database $($db.DatabaseName) restored successfully\" -LogPath \"$LogPath$LogFileName\";\n\n        #run a dbbc checkdb\n        #QueryTimeout of 4h\n        $DBCC = Invoke-dbaQuery -SQLInstance $DestinationInstance -QueryTimeout 14400 -Database $destDBName -Query \"DBCC CHECKDB WITH NO_INFOMSGS\" -MessagesToOutput;\n        \n        #LOG\n        If ([string]::IsNullOrEmpty($DBCC)){\n            Out-dbiLog -Message \"Integrity Check for database $($db.DatabaseName) done successfully\" -LogPath \"$LogPath$LogFileName\";\n            }\n        Else {\n            Out-dbiLog -Message \"Integrity Check for database $($db.DatabaseName) failed\" -LogPath \"$LogPath$LogFileName\";\n            }\n\n        #drop database after\n        $drop = Remove-DbaDatabase -SqlInstance $DestinationInstance -Database $destDBName -Confirm:$false;\n    }\n\n}\n\n$statusList | FT status, starttime, endtime, error;\n<\/pre>\n<p>As you may have noticed one function is missing, Restore-dbiRubrikDatabase, I will point out this one in another blog post.<br \/>\nI hope those script could help.<br \/>\nHappy scripting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As promised during my last Rubrik blog post I&#8217;m writing a second one to explain how to: log your different steps in a file add an integrity check after the restore and also improve my first scripting I will start by the end and improve my first scripts by creating functions for each step of&hellip;&nbsp;<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133,99],"tags":[202,272,854,2341],"class_list":["post-16534","post","type-post","status-publish","format-standard","category-database","category-sql-server","tag-backup","tag-powershell","tag-restore","tag-rubrik"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Automate restore from Rubrik with PowerShell (part 2) - dbi services Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automate restore from Rubrik with PowerShell (part 2)\" \/>\n<meta property=\"og:description\" content=\"As promised during my last Rubrik blog post I&#8217;m writing a second one to explain how to: log your different steps in a file add an integrity check after the restore and also improve my first scripting I will start by the end and improve my first scripts by creating functions for each step of&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-16T10:06:05+00:00\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Savorgnano\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Savorgnano\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/\"},\"author\":{\"name\":\"St\u00e9phane Savorgnano\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/adf6293d8bc8a7a26490acfe2918b6d7\"},\"headline\":\"Automate restore from Rubrik with PowerShell (part 2)\",\"datePublished\":\"2021-07-16T10:06:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/\"},\"wordCount\":391,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"keywords\":[\"Backup\",\"PowerShell\",\"Restore\",\"Rubrik\"],\"articleSection\":[\"Database\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/\",\"name\":\"Automate restore from Rubrik with PowerShell (part 2) - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-07-16T10:06:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-restore-from-rubrik-with-powershell-part-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automate restore from Rubrik with PowerShell (part 2)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/adf6293d8bc8a7a26490acfe2918b6d7\",\"name\":\"St\u00e9phane Savorgnano\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"caption\":\"St\u00e9phane Savorgnano\"},\"description\":\"St\u00e9phane Savorgnano has more than 20 years of experience in Microsoft software development and SQL Server database solutions, specializing in SQL Server installation, performance analysis, and best practices. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server 2012 through 2017, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. Prior to dbi services, he was a software engineer at Ciba Specialty Chemicals in Basel. He holds a Master's degree in Informatics from the University of Mulhouse. His industry experience covers banking and financial services, chemicals, and pharmaceuticals.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/stephane-savorgnano\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Automate restore from Rubrik with PowerShell (part 2) - dbi services Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/","og_locale":"en_US","og_type":"article","og_title":"Automate restore from Rubrik with PowerShell (part 2)","og_description":"As promised during my last Rubrik blog post I&#8217;m writing a second one to explain how to: log your different steps in a file add an integrity check after the restore and also improve my first scripting I will start by the end and improve my first scripts by creating functions for each step of&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2021-07-16T10:06:05+00:00","author":"St\u00e9phane Savorgnano","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"St\u00e9phane Savorgnano","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/"},"author":{"name":"St\u00e9phane Savorgnano","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/adf6293d8bc8a7a26490acfe2918b6d7"},"headline":"Automate restore from Rubrik with PowerShell (part 2)","datePublished":"2021-07-16T10:06:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/"},"wordCount":391,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"keywords":["Backup","PowerShell","Restore","Rubrik"],"articleSection":["Database","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/","url":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/","name":"Automate restore from Rubrik with PowerShell (part 2) - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2021-07-16T10:06:05+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/automate-restore-from-rubrik-with-powershell-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Automate restore from Rubrik with PowerShell (part 2)"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/adf6293d8bc8a7a26490acfe2918b6d7","name":"St\u00e9phane Savorgnano","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","caption":"St\u00e9phane Savorgnano"},"description":"St\u00e9phane Savorgnano has more than 20 years of experience in Microsoft software development and SQL Server database solutions, specializing in SQL Server installation, performance analysis, and best practices. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server 2012 through 2017, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. Prior to dbi services, he was a software engineer at Ciba Specialty Chemicals in Basel. He holds a Master's degree in Informatics from the University of Mulhouse. His industry experience covers banking and financial services, chemicals, and pharmaceuticals.","url":"https:\/\/www.dbi-services.com\/blog\/author\/stephane-savorgnano\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=16534"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/16534\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=16534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=16534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=16534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}