Restoring resources using PowerShell cmdlets

Restoring an Exchange database includes initiating a connection session with the SnapCenter Server, listing the backups and retrieving backup information, and restoring a backup.

Before you begin

You must have prepared the PowerShell environment to execute the PowerShell cmdlets.

About this task

The information regarding the parameters that can be used with the cmdlet and their descriptions can be obtained by runningGet-Help command_name. Alternatively, you can also refer to the Cmdlet Reference Guide.

SnapCenter Software 4.2 Windows Cmdlet Reference Guide

Steps

  1. Initiate a connection session with the SnapCenter Server for a specified user by using the Open-SmConnection cmdlet.
    Example
    Open-smconnection  -SMSbaseurl  https:\\snapctr.demo.netapp.com:8146/
    
  2. Retrieve the information about the one or more backups that you want to restore by using the Get-SmBackup cmdlet.
    Example

    This example displays information about all available backups:

    PS C:\> Get-SmBackup
    
    BackupId                      BackupName                    BackupTime                    BackupType
    --------                      ----------                    ----------                    ----------
    341                           ResourceGroup_36304978_UTM... 12/8/2017 4:13:24 PM          Full Backup
    342                           ResourceGroup_36304978_UTM... 12/8/2017 4:16:23 PM          Full Backup
    355                           ResourceGroup_06140588_UTM... 12/8/2017 6:32:36 PM          Log Backup
    356                           ResourceGroup_06140588_UTM... 12/8/2017 6:36:20 PM          Full Backup
    
    
  3. Restore data from the backup by using the Restore-SmBackup cmdlet.
    Example

    This example restores an up-to-the-minute backup:

    C:\PS> Restore-SmBackup -PluginCode SCE -AppObjectId 'sce-w2k12-exch.sceqa.com\sce-w2k12-exch_DB_2' -BackupId 341
    
    Example

    This example restores a point-in-time backup:

    C:\ PS> Restore-SmBackup -PluginCode SCE -AppObjectId 'sce-w2k12-exch.sceqa.com\sce-w2k12-exch_DB_2' -BackupId 341 -LogRestoreType ByTransactionLogs -LogCount 2
    Example

    This example restores a backup on secondary storage to primary story:

    C:\ PS> Restore-SmBackup -PluginCode 'SCE' -AppObjectId 'DB2' -BackupId 81 -Confirm:$false  
    -archive @{Primary="paw_vs:vol1";Secondary="paw_vs:vol1_mirror"} -logrestoretype All

    The -archive parameter enables you to specify the primary and secondary volumes you want to use for the restore.