- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
This is a Community user generated knowledge article authored by Antonino Bambino at ion group. You can view Antonino's blog here where he posts similar articles to help his CyberArk peers.
Backup is part of the security policies and it is essential that it is performed and monitored to always maintain an offline copy of the data.
This article focuses on some points regarding configuring the backup schedule using Windows Task Scheduler and complements the article PAReplicate Configuration and Usage
Note: Some configurations may vary based on the security policies applied and based on the Operating System.
Based on company policy, different users may be used to execute the scheduled task and it will be possible to choose whether to execute the task on one of the PAM infrastructure servers (for example a PVWA) or on an external server. The choice of which server to use may depend on various factors such as company policies, network configurations, resource availability, etc.
Some of the more commonly used solutions will be examined below.
For account scheduling you can use:
What are the differences between the three account types?
Attention: the local\domain account and MSA must be placed in the local Administrators group.
NT AUTHORITY\System or Local\Domain Account:
For an NT AUTHORITY\System or Local\Domain Account it is possible to create the scheduled task directly from the Windows Schedule Task graphical interface.
1.Create a new task, name it, and set the Built-In SYSTEM account or similar local\domain account to perform the backup in the General tab:
2. Within the 'Triggers' tab create a new schedule for the task based on your current needs. Here we have a it set to run weekly on Sunday:
3. On the Actions tab create 'New Actions' and set the following:
Program/script: "C:\Program Files (x86)\PrivateArk\Replicate\PAReplicate.exe" (with double quotes)
Add arguments: Vault.ini /LOGONFROMFILE backup.cred /FULLBACKUP
Start in: C:\Program Files (x86)\PrivateArk\Replicate
4. Press 'OK' and your task should be setup.
MSA or gMSA Account:
For MSA or gMSA accounts it is necessary to create the scheduled task from PowerShell.
Note: Creating the MSA or gMSA account requires the use of elevated credentials and Active Directory information. For more information about MSA please refer to Microsoft documentations.
In the following example we will create a gMSA and schedule the task on a server:
Example:
New-ADServiceAccount -Name gMSAbck-SRV-01 -Path "CN = Managed Service Accounts, DC=cyberark, DC=local" -DNSHostName gMSAbck-SRV-01.cyberark.local
Set-ADServiceAccount -Identity gMSAbck-SRV-01 -PrincipalsAllowedToRetrieveManagedPassword SRV-01$
Install-ADServiceAccount -Identity gMSAbck-SRV-01
# Creation and scheduling backup jobs
$sta = New-ScheduledTaskAction -Execute "C:\Program Files (x86)\PrivateArk\Replicate\PAReplicate.exe" -Argument "Vault.ini /LOGONFROMFILE backup.cred /FULLBACKUP" -WorkingDirectory "C:\Program Files (x86)\PrivateArk\Replicate"
$stt = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Saturday -At "05/11/2024 10:00PM"
$stp = New-ScheduledTaskPrincipal -UserID CYBERARK\MSAbck-SRV-01$ -LogonType Password
$sts = New-ScheduledTaskSettingsSet -ExecutionTimeLimit (New-TimeSpan -Hours 12)
Register-ScheduledTask "CyberArk Vault Full Backup" -Action $sta -Settings $sts -Trigger $stt -Principal $stp
Interaction between Group Policy and Task scheduling
Execution of the scheduled task may not work due to security restrictions imposed through a Group Policy.
For example, if the backup is scheduled in the PVWA server it is necessary to add the MSA account into the Security Policy Setting “Log on as a service”: