Backing up resources using PowerShell cmdlets

Backing up a SQL Server database or Windows file system includes establishing a connection with the SnapCenter Server, discovering the SQL Server database instances or Windows file systems, adding a policy, creating a backup resource group, backing up, and verifying the backup.

Before you begin

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/
    The username and password prompt is displayed.
  2. Create a backup policy by using the Add-SmPolicy cmdlet.
    Example

    This example creates a new backup policy with a SQL backup type of FullBackup:

    PS C:\> Add-SmPolicy -PolicyName TESTPolicy 
    -PluginPolicyType SCSQL -PolicyType Backup 
    -SqlBackupType FullBackup -Verbose
    
    Example

    This example creates a new backup policy with a Windows file system backup type of CrashConsistent:

    PS C:\> Add-SmPolicy -PolicyName FileSystemBackupPolicy 
    -PluginPolicyType SCW -PolicyType Backup 
    -ScwBackupType CrashConsistent -Verbose
    
  3. Discover host resources by using the Get-SmResources cmdlet.
    Example

    This example discovers the resources for the Microsoft SQL plug-in on the specified host:

    C:\PS>PS C:\> Get-SmResources -HostName vise-f6.sddev.mycompany.com 
    -PluginCode SCSQL
    Example

    This example discovers the resources for Windows file systems on the specified host:

    C:\PS>PS C:\> Get-SmResources -HostName vise2-f6.sddev.mycompany.com 
    -PluginCode SCW
  4. Add a new resource group to SnapCenter by using the Add-SmResourceGroup cmdlet.
    Example

    This example creates a new SQL database backup resource group with the specified policy and resources:

    PS C:\> Add-SmResourceGroup -ResourceGroupName AccountingResource 
    -Resources @{"Host"="visef6.org.com";
    "Type"="SQL Database";"Names"="vise-f6\PayrollDatabase"} 
    -Policies "BackupPolicy"
    
    Example

    This example creates a new Windows file system backup resource group with the specified policy and resources:

    PS C:\> Add-SmResourceGroup -ResourceGroupName EngineeringResource
    -PluginCode SCW -Resources @{"Host"="WIN-VOK20IKID5I";
    "Type"="Windows Filesystem";"Names"="E:\"} 
    -Policies "EngineeringBackupPolicy"
    
  5. Initiate a new Snapshot copy job by using the New-SmBackup cmdlet.
    Example
    PS C:> New-SmBackup -ResourceGroupName PayrollDataset -Policy FinancePolicy
    
  6. View the status of the backup job by using the Get-SmBackupReport cmdlet.
    Example

    This example displays a job summary report of all jobs that were run on the specified date:

    PS C:\> Get-SmJobSummaryReport -Date ?1/27/2016?