How to configure Windows Task Scheduler for PAReplicate

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

PAM Self-Hosted Articles
4 min read
L7 Applicator
No ratings

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. 

Steps

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:

  • NT AUTHORITY\SYSTEM
  • Local\Domain Account
  • MSA or gMSA


What are the differences between the three account types?

  • NT AUTHORITY\SYSTEM is a local Built-In account with administrative privileges whose password is managed by the operating system.
  • Local\Domain Accounts are accounts (local or domain) whose password will need to be managed.
  • MSA or gMSA is a domain service account that can be configured to use for a single server. The password is automatically managed at domain level.


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:

ka3Vy000005KNdVIAW__eid=ka3Vy000005KNdV&feoid=00N2J000009R3kv&refid=0EMHt0000077oXf.png

 

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:

 

ka3Vy000005KNdVIAW__eid=ka3Vy000005KNdV&feoid=00N2J000009R3kv&refid=0EMHt0000077y7d.png

 

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

ka3Vy000005KNdVIAW__eid=ka3Vy000005KNdV&feoid=00N2J000009R3kv&refid=0EMHt0000077oXg.png

 

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:

# Account creation
# Domain Name: cyberark.local
# Server Name: SRV-01
# gMSA: gMSAbck-SRV-01

 

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

ka3Vy000005KNdVIAW__eid=ka3Vy000005KNdV&feoid=00N2J000009R3kv&refid=0EMHt0000077oXh.png

ka3Vy000005KNdVIAW__eid=ka3Vy000005KNdV&feoid=00N2J000009R3kv&refid=0EMHt0000077oXi.png

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”:

ka3Vy000005KNdVIAW__eid=ka3Vy000005KNdV&feoid=00N2J000009R3kv&refid=0EMHt0000077oXj.png

ka3Vy000005KNdVIAW__eid=ka3Vy000005KNdV&feoid=00N2J000009R3kv&refid=0EMHt0000077oXk.png

 

Rate this article:
  • 2000 Views
  • 0 comments
  • 0 Likes
Article Dashboard
Version history
Last Updated:
‎04-02-2025 05:52 AM
Updated by: