From ae3e391e5c3d93edac585215baa0b088ddf79ef1 Mon Sep 17 00:00:00 2001 From: James Pattinson Date: Mon, 8 Sep 2025 13:56:52 +0100 Subject: [PATCH] Release --- monthlySnap.ps1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/monthlySnap.ps1 b/monthlySnap.ps1 index ae35cfc..ef2dc76 100644 --- a/monthlySnap.ps1 +++ b/monthlySnap.ps1 @@ -5,8 +5,11 @@ # # Must be run with a Global service account. # -# Requires RubrikSecurityCloud module to be installed and working against -# a Global Service Account with Administrator rights. +# Requires RubrikSecurityCloud module to be installed and working with +# a Global Service Account with the following rights: +# +# - Data Management / Oracle / On-Demand Snapshot +# - Data Management / SLAs / Both Source and Target SLAs # # Create the service account file with: # Set-RscServiceAccountFile sa.json -OutputFilePath Global.xml @@ -32,7 +35,8 @@ param ( [switch]$dryrun ) -$GlobalSAFile = "C:\Rubrik\james.xml" +# SA File must be an absolute path +$GlobalSAFile = "C:\Rubrik\rscSa.xml" $logFile = "C:\Rubrik\monthlySnap.log" ########################### @@ -94,7 +98,11 @@ if ($dryrun) { $query.Var.input.Config.baseOnDemandSnapshotConfig.slaId = $monthlySla.id $query.Field = Get-RscType -Name AsyncRequestStatus -InitialProperties id $result = $query.Invoke() - Write-Log "Backup triggered for Name: $($_.Name), Id: $result.Id" + if ($result -and $result.Id) { + Write-Log "Backup triggered for Name: $($_.Name), Job ID: $($result.Id)" + } else { + Write-Log "Backup triggered for Name: $($_.Name), but no Job ID returned." + } } }