Snippet of Script to backup all of my UCS domains in one pass. There is a credential file C:\scripts\creds\all.xml. Feel free to modify this script as needed
Import-Module CiscoUcsPS
$a = Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true
$CredFileKey = ConvertTo-SecureString 'timetolockit' -AsPlainText -Force
$handle1 = connect-ucs -LiteralPath C:\scripts\creds\all.xml -key $credfilekey
$configallbackup = Backup-Ucs -Type config-all -PathPattern 'c:\ucs\backups\${ucs}-${MM}-${dd}-${yyyy}-config-all.xml'
$fullstatebackup = Backup-Ucs -Type full-state -PathPattern 'c:\ucs\backups\${ucs}-${MM}-${dd}-${yyyy}-full-state.bin'
Sidenote & Caution: It is unnecessary to use Get-Date as we already have date available with the PathPattern argument.
Comments
0 comments
Please sign in to leave a comment.