Lab configuration commands¶
A lab configuration says what to install where: the Vault, the components, their servers and installers. These commands compose it, check it, show its plan and save it. None of them contacts a server, and a configuration never contains a password.
$media = Get-PASMediaInventory -Path D:\CyberArk | Get-PASMediaSelection
$cfg = New-PASLabConfiguration -Environment MyLab -VaultMode Primary -PrimaryAddress 192.0.2.11 `
-ControllerAddress 192.0.2.10 -Media $media -SecurityProfile Lab `
-Instances @(@{ Type = 'PVWA'; Name = 'PVWA01'; Address = '192.0.2.21' })
Test-PASLabConfiguration -Configuration $cfg -CheckMedia | Format-List Valid, Issues, Warnings
Export-PASLabConfiguration -Configuration $cfg -Path .\MyLab.json
The text of every command below is its own help (Get-Help <command> -Full).
| Command | What it does |
|---|---|
New-PASLabConfiguration |
Composes the configuration of a lab: the Vault (new Primary, Primary and DR, or an existing Vault) and up to 4 each of PVWA, CPM, PSM, PSMP, HTML5 Gateway and one PTA. Nothing is contacted or installed. |
Test-PASLabConfiguration |
Checks a lab configuration: structure, topology rules and, with -CheckMedia, the installer files. |
Get-PASLabPlan |
Shows what a configuration would install: one item per component with its server, installer and order. |
Export-PASLabConfiguration |
Saves a lab configuration as a JSON file. The file never contains a password. |
Import-PASLabConfiguration |
Reads a lab configuration from a JSON file and returns it as an ordered hashtable. |
Get-PASCredentialRequirement |
Lists the server accounts and passwords a lab configuration needs before it can be installed. |
Get-PASStageCatalog |
Lists the installation stages of a component type, in the order they run. |
New-PASLabConfiguration¶
Composes the configuration of a lab: the Vault (new Primary, Primary and DR, or an existing Vault) and up to 4 each of PVWA, CPM, PSM, PSMP, HTML5 Gateway and one PTA. Nothing is contacted or installed.
Returns the configuration as an ordered hashtable. Check it with Test-PASLabConfiguration, look at the result with Get-PASLabPlan, save it with Export-PASLabConfiguration and install it with Install-PASLab. The configuration never contains a password.
The only thing this command may write is a copy of an installer that you selected inside a ZIP bundle: it is extracted once into the media cache under the data folder of this controller.
| Parameter | Meaning |
|---|---|
-Environment |
Name of the environment (letters, digits, dot, dash, underscore; at most 64 characters). |
-VaultMode |
Primary: install a new Primary Vault. PrimaryDR: install a new Primary and a DR Vault. Existing: use a Vault that is already installed (-ExistingVaultAddress) and install components only. |
-Instances |
The component servers: @( @{ Type = 'PVWA'; Name = 'PVWA01'; Address = '192.0.2.21'; Username = '' } ). Type is PVWA, CPM, PSM, PSMP, HTML5GW or PTA (up to 4 of each, one PTA). PTA needs a RHEL-family server with 8 GB, a PVWA in the same lab and a PSMP package in the media; its instance may carry VaultTimezone, the time zone of the Vault server as a tz database name (default UTC). HTML5GW is the PSM HTML5 Gateway: a container on a Linux server (Docker on Ubuntu, Podman on the RHEL family) that may share the server of a PSMP; it needs a PVWA in the same lab and the PACLI package in the media. Name is the host name of the server; the component id in the configuration is its lower-case form. Instances with the same address share one server, named after the first instance. Username is optional. Linux instances may carry IdentityFile and KnownHostsFile; otherwise the key of this controller under <data folder>\ssh\<environment> is used (created and authorised on the first install). |
-ControllerAddress |
IPv4 address of this controller as the Vault servers see it. Needed for a new Vault. |
-PrimaryAddress |
Address of the server that becomes the Primary Vault (VaultMode Primary or PrimaryDR). |
-DRAddress |
Address of the server that becomes the DR Vault (VaultMode PrimaryDR). |
-ExistingVaultAddress |
Address of the existing Vault (VaultMode Existing). |
-Username |
Default Windows account name for the servers. Default: Administrator. |
-LinuxUsername |
Default Linux account name. Default: root (PSMP is installed as root). |
-Media |
The installers to use: @{ Vault = item; PACLI = item; DR = item; PVWA = item; CPM = item; PSM = item; PSMP = item; HTML5GW = item; PTA = item; License = item; RecoveryKey = item }. Only the ones the lab needs. An item is an object from Get-PASMediaInventory, @{ Path = ...; Entry = ... } or a plain file path. Get-PASMediaSelection builds this hashtable. |
-ExecutionMode |
Parallel (default): the servers are installed at the same time; the steps that sign in to the Vault wait until the Primary Vault is installed and then run one at a time (PVWA, CPM, PSM and PSMP, PTA last). Sequential: one component after the other. |
-PrimaryUsername |
Windows account name for the Primary Vault server, if it differs from -Username. |
-DRUsername |
Windows account name for the DR Vault server, if it differs from the Primary. |
-SecurityProfile |
Secure (default) or Lab. Lab adds the explicit, audited deviations a template-built lab needs: self-signed WinRM certificates, RDP to the Vault from the controller, a self-signed PVWA certificate that CPM pins. Only the Lab profile was tested; Secure is not qualified. |
-AcceptEula |
Confirms that you read and accept the CyberArk end user license agreement of the PSMP, HTML5 Gateway and PTA installers. Required when the lab contains a PSMP, an HTML5 Gateway or PTA. |
-DomainMode |
None (default): the servers stay in their workgroup. New: a new Active Directory forest is created on the server at -DomainControllerAddress. Existing: an existing domain is used. With New and Existing the Windows servers of PVWA, CPM and PSM are joined to the domain before they are installed (they restart once). Vault servers are never joined. With New, the CyberArk hardening GPOs of the vendor packages are imported into the new domain and applied to the joined servers after the installation. An existing domain is not changed: import those GPOs there yourself. |
-DomainName |
DNS name of the domain, for example pam.lab. |
-DomainControllerAddress |
DomainMode New: IPv4 address of the Windows server that becomes the domain controller (it must have a static address and nothing else is installed on it). DomainMode Existing: IPv4 address of a DNS server of the domain, usually a domain controller. |
-DomainUsername |
Account name without the domain, default Administrator. DomainMode New: the local administrator of the new domain controller, who becomes the administrator of the domain. DomainMode Existing: a domain account that may join computers. |
-InstallerName |
User name the CyberArk installers record ("who installs"). Default: what the vendor files contain ("Windows User"; "CyberArk Vault Image" for the Vault). Letters, digits, spaces and simple punctuation. |
-InstallerCompany |
Company name the CyberArk installers record. Default: what the vendor files contain ("My Company"; "CyberArk" for the Vault). |
-SkipHardening |
Installs and registers the components but does not run the vendor hardening on any server: not on the Vault, not on PVWA, CPM, PSM or PSMP, and no hardening GPOs in a new domain. For tests that need servers without the security settings. Only with -SecurityProfile Lab. |
-DataRoot |
Data folder of this controller (media cache, SSH keys). Default: %LOCALAPPDATA%\PASeasyInstall. |
$media = Get-PASMediaSelection -Inventory (Get-PASMediaInventory -Path D:\CyberArkMedia)
$cfg = New-PASLabConfiguration -Environment MyLab -VaultMode PrimaryDR -PrimaryAddress 192.0.2.11 -DRAddress 192.0.2.12 `
-ControllerAddress 192.0.2.10 -Media $media -SecurityProfile Lab `
-Instances @(@{ Type = 'PVWA'; Name = 'PVWA01'; Address = '192.0.2.21' }, @{ Type = 'CPM'; Name = 'CPM01'; Address = '192.0.2.21' })
Export-PASLabConfiguration -Configuration $cfg -Path .\MyLab.json
A Primary and DR Vault plus PVWA and CPM on one shared server, saved as MyLab.json.
$cfg = New-PASLabConfiguration -Environment MyLab -VaultMode Existing -ExistingVaultAddress 192.0.2.11 -Media $media `
-Instances @(@{ Type = 'PSM'; Name = 'PSM01'; Address = '192.0.2.23' })
Test-PASLabConfiguration -Configuration $cfg -CheckMedia
A PSM server for a Vault that already exists, then validated.
Test-PASLabConfiguration¶
Checks a lab configuration: structure, topology rules and, with -CheckMedia, the installer files.
Returns one object with Valid (true or false), Issues (what must be corrected), Warnings and the normalized Configuration. Lab security deviations appear as warnings that start with "SECURITY DEVIATION". No server is contacted and nothing is changed.
To check the servers themselves (reachable, WinRM, disk space) use Test-PASPreflight.
| Parameter | Meaning |
|---|---|
-Path |
Configuration file (JSON). |
-Configuration |
Configuration object, as returned by New-PASLabConfiguration or Import-PASLabConfiguration. |
-CheckMedia |
Also checks that the installer file of every component exists. |
Test-PASLabConfiguration -Path .\MyLab.json -CheckMedia | Format-List Valid, Issues, Warnings
if (-not (Test-PASLabConfiguration -Configuration $cfg).Valid) { 'Not ready yet' }
Get-PASLabPlan¶
Shows what a configuration would install: one item per component with its server, installer and order.
A dry run. Returns the plan with Name, Items, DomainJoins and Warnings. Each item has Id, Name, Type, Host, Address, Os, Media and DependsOn; the items are listed in installation order. No server is contacted and nothing is changed.
With -ResolveMedia the exact installer files are resolved and hashed too (plan properties Media and MediaDigest). That reads every installer once and can take a few minutes.
| Parameter | Meaning |
|---|---|
-Path |
Configuration file (JSON). |
-Configuration |
Configuration object, as returned by New-PASLabConfiguration or Import-PASLabConfiguration. |
-ResolveMedia |
Also resolves and hashes the installer files that would be used. |
(Get-PASLabPlan -Path .\MyLab.json).Items | Format-Table Id, Type, Address, Media, DependsOn
Get-PASLabPlan -Configuration $cfg -ResolveMedia | Select-Object -ExpandProperty Media
Export-PASLabConfiguration¶
Saves a lab configuration as a JSON file. The file never contains a password.
Validates the configuration first; a configuration with issues is not saved. An existing file is only replaced with -Force. The file is written completely or not at all. Returns the full path.
Read the file again with Import-PASLabConfiguration, or pass it to Install-PASLab -Path.
| Parameter | Meaning |
|---|---|
-Configuration |
Configuration object, as returned by New-PASLabConfiguration. |
-Path |
File to write, e.g. .\MyLab.json. The folder is created when it does not exist. |
-Force |
Replaces an existing file. |
Export-PASLabConfiguration -Configuration $cfg -Path .\MyLab.json
$cfg | Export-PASLabConfiguration -Path D:\Labs\MyLab.json -Force
Import-PASLabConfiguration¶
Reads a lab configuration from a JSON file and returns it as an ordered hashtable.
The result can be changed in memory (for example $cfg.hosts.pvwa01.address = '192.0.2.31') and then passed to Test-PASLabConfiguration, Get-PASLabPlan, Install-PASLab or Export-PASLabConfiguration. The file is only read and parsed; use Test-PASLabConfiguration to validate it.
| Parameter | Meaning |
|---|---|
-Path |
Configuration file (JSON), as written by Export-PASLabConfiguration or the desktop wizard. |
$cfg = Import-PASLabConfiguration -Path .\MyLab.json
$cfg = Import-PASLabConfiguration .\MyLab.json
$cfg.name = 'MyLab2'
Export-PASLabConfiguration -Configuration $cfg -Path .\MyLab2.json
Copies a configuration under a new environment name.
Get-PASCredentialRequirement¶
Lists the server accounts and passwords a lab configuration needs before it can be installed.
Returns one object per requirement with:
Kind Credential (an account with its password) or Secret (a password only)
Key the key to use in -CredentialMap or -SecretMap of Install-PASLab and Resume-PASRun
HostId the server id in the configuration (empty for secrets)
User the account name the configuration expects
Os Windows or Linux
Label a description to show when asking for it
Secrets are VaultAdmin (Vault Administrator password), VaultMaster and DRPassword (new Vault and DR), ADSafeMode (new domain) and DomainJoinPassword. A Linux server is listed when the controller key still has to be authorised there with the password of the account. Nothing is contacted and nothing is asked.
| Parameter | Meaning |
|---|---|
-Path |
Configuration file (JSON). |
-Configuration |
Configuration object, as returned by New-PASLabConfiguration or Import-PASLabConfiguration. |
Get-PASCredentialRequirement -Path .\MyLab.json | Format-Table Kind, Key, User, Label
$creds = @{}
Get-PASCredentialRequirement -Configuration $cfg | Where-Object Kind -eq 'Credential' | ForEach-Object {
$creds[$_.Key] = Get-Credential -UserName $_.User -Message $_.Label
}
Collects the server accounts into a hashtable for Install-PASLab -CredentialMap.
Get-PASStageCatalog¶
Lists the installation stages of a component type, in the order they run.
Returns one object per stage with Component, Stage and Order. The stage names are the step ids you see as Stage in Get-PASRunEvent and that Resume-PASRun -RetryStep accepts.
The list is read from what the installer really runs: the Vault and DR workflow files of the module, and the step list the workflow generator uses for PVWA, CPM, PSM, PSMP, HTML5GW, PTA and AD. DomainJoin lists the steps that join one server to the domain. Not listed, because they depend on the run: the extra passes and restarts of a PSM stage (<stage>-pass2, <stage>-reboot), the upload of a certificate pinned by CPM (pvwa-trust-certificate) and the steps the controller performs itself (ssh-bootstrap, media-select).
| Parameter | Meaning |
|---|---|
-Component |
Vault, DR, PVWA, CPM, PSM, PSMP, HTML5GW, PTA, AD or DomainJoin. Default: all of them. |
Get-PASStageCatalog -Component Vault | Format-Table Order, Stage
'PVWA', 'CPM' | Get-PASStageCatalog | Format-Table Component, Order, Stage