Microsoft Virtualization Discussions

SMSQL snapvault post script

ANDY_MCKEE
3,353 Views

Hi, I'm looking for some help again 🙂  Ideally i'd like to replace all rsh based batch files for the post backup  snapvaultscripts with a powershell script based on the toolkit commands.

Snapmanger calls a bat file which in turn runs a ps1 file containing the  Start-NasnapVaultSecTransfer (s) and the Start-NaSnapvaultSecSnapshot.

My issue due to my limited scripting ability is transfering the post command arguments from SnapManager -PostCmdArgs '$SqlSnapshot $SqlSnapshot $InfoSnapshot' into the -PrimarySnapshot

I can get the script to work no issue when using and explicitly stating an (_recent) snapshot in the powershell script.  But we would like stick with timestamped snapmanager source snapshots.

Has anyone achieved this or any scripting tips?

Thanks in advance,

Andy

2 REPLIES 2

stephan_troxler
3,353 Views

You can access parameters in Powershell like this:

param($value1,$value2)

To update the Vault relationship with the latest snapshot the script could look like this:

param($SqlSnapshot,$InfoSnapshot)

Start-NaSnapvaultSecTransfer /vol/vol_primary/qtree_primary -PrimarySnapshot $SqlSnapshot

ivan_huter
3,353 Views

Try this script: https://communities.netapp.com/docs/DOC-15159

Good luck!

--Ivan

Public