Add scheduled task XML

This commit is contained in:
2025-09-11 12:56:57 +01:00
parent 73fdffaa57
commit 4776823524
4 changed files with 16 additions and 11 deletions

View File

@@ -1,21 +1,18 @@
##########################################################################
#
# On Demand Snapshot for all Oracle DBs with a specific SLA
# Created by Rubrik PS for McDermott, September 2025
# Update an SLA MV to point to the local host
# Created by Rubrik PS for ZF, September 2025
#
# Must be run with a Global service account.
#
# 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
# a Global Service Account with the following rights (TBC)
#
# Create the service account file with:
# Set-RscServiceAccountFile sa.json -OutputFilePath Global.xml
#
# Example invocation
# .\monthlySnap.ps1 -sourceSla "Prod Oracle SLA" -triggerSla "Oracle Monthly Only"
# .\claimInstance.ps1 -sqlInstance "sqlfcsql\TESTINST" -mvName "JP-ZF-SQL"
#
# v0.1 Initial Release
#
@@ -24,7 +21,7 @@
param (
[Parameter(Mandatory=$False,
HelpMessage="Instance to claim")]
[string]$sourceSla,
[string]$sqlInstance,
[Parameter(Mandatory=$False,
HelpMessage="Do not change the MV")]
@@ -47,7 +44,7 @@ $ErrorActionPreference = 'Stop'
function Write-Log($message) {
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logEntry = "$timestamp $message"
Add-Content -Path "C:\Rubrik\monthlySnap.log" -Value $logEntry
Add-Content -Path $logFile -Value $logEntry
Write-Host $logEntry
}
@@ -103,7 +100,7 @@ if ($myHost.Id -ne $mvDetail.hostDetail.Id) {
$query.Var.input.Id = $mvDetail.Id
$query.Var.input.update.Name = $mvName
$query.Var.input.update.config.SmbDomainName = $mvDetail.SmbShare.DomainName
$query.Var.input.update.config.SmbValidIps = $mvDetail.SmbShare.ValidIps
$query.Var.input.update.config.SmbValidIps = $myHost.Name
$query.Var.input.update.config.SmbValidUsers = $mvDetail.SmbShare.ValidUsers + $mvDetail.SmbShare.ActiveDirectoryGroups
$query.Var.input.update.slaClientConfig.clientHostId = $myHost.Id
$query.Var.input.update.slaClientConfig.channelHostMountPaths = $mvDetail.ClientConfig.ChannelHostMountPaths