Backup DataCore SANsymphony-V config using PowerShell

In November 2013 I published a PowerShell script on that creates a backup of your SANsymphony-V config by using the DataCore SANsymphony-V PowerShell cmdlets. I would like to thank Marcel, Michael and Frank for their feedback and comments to improve the script. The password is stored in the securestring.txt that needs to be stored in the same directory as the script. Kudos to Marcel, who has the part of the script contributed, that stores the password in an encrypted file.

Currently there is no way to schedule a configuration backup using the DataCore GUI. A valid backup of the configuration can be a lifesaver, especially in the case, that you storage server crashed and it has to be re-installed. So it’s a good idea to regularly backup the configuration to the local disk and copy this backup to another location. One way to create a backup, is an Outlook task and the DataCore GUI. Belive me, that will not work… At this point my script comes into play. The script uses Microsoft PowerShell, DataCore SANsymphony-V PowerShell cmdlets and the Windows Task Scheduler to automate the backup of SANsymphony-V configuration.

There are a couple of variables used in the script. Two of them are used to change the number of stored backups and the directory in which the backups will be saved. The script saves the last three versions of the configuration backups, but you can change this with the $Keep variable. The directory, in which the backup will be saved, is influenced by the $BackupFolder variable.

You can call the script using the Taskplanner with the following command:

You can select a different directory than C:\Scripts. The “Out-Null” behind the pipe symbol suppresses the output of the script.

Backup DataCore SANsymphony-V config using PowerShell
5 (100%) 6 votes
Patrick Terlisten
Follow me

Patrick Terlisten is the personal blog of Patrick Terlisten. Patrick has over 15 years experience in IT, especially in the areas infrastructure, cloud, automation and industrialization. Patrick was selected as VMware vExpert (2014 - 2016), as well as PernixData PernixPro.

Feel free to follow him on Twitter and/ or leave a comment.
Patrick Terlisten
Follow me

Latest posts by Patrick Terlisten (see all)

Related Posts:

2 thoughts on “Backup DataCore SANsymphony-V config using PowerShell

  1. Brian Farrugia

    Hi Patrick,
    thank you very much for this post. I am implementing this script on a setup we are doing.
    I would like to add a little something.
    I have updated the line

    do {$Files | Sort-Object CreationTime | Select-Object -First ($Files.Count – $Keep)| Remove-Item} until ($Files.Count -ge $Keep)


    If ($File.Count -gt 3) {
    do {$Files | Sort-Object CreationTime | Select-Object -First ($Files.Count – $Keep)| Remove-Item} until ($Files.Count -ge $Keep)

    I did this because when the Backup folder was empty or had less than 3 files in it,
    Powershell would generate the below errors in a continuous loop.

    Select-Object : Cannot validate argument on parameter ‘First’. The -3 argument is less than the minimum allowed range of 0. Supply an argument that is
    greater than or equal to 0 and then try the command again.
    At C:\SSVBACKUP_Script\Backup-DataCoreConfig.ps1:22 char:62
    + do {$Files | Sort-Object CreationTime | Select-Object -First ($Files.Count – $Ke …
    + ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (:) [Select-Object], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.SelectObjectCommand

    Thanks again.

  2. Pingback: Control Datacore SSV Write Cache with APC PCNS | Phy2Vir

Leave a Reply

Your email address will not be published. Required fields are marked *