=============== LIBRARY RULES =============== From library maintainers: - This is unofficial documentation - always verify against official Veeam Help Center - docs/em/ and docs/em_rest/ are docs for Enterprise Manager - docs/cloud/ is for Cloud Connect # Veeam Backup & Replication Documentation Veeam Backup & Replication (VBR) is an enterprise-grade data protection and disaster recovery solution for virtual, physical, and cloud-based workloads. It provides comprehensive backup, replication, and recovery capabilities for VMware vSphere, Microsoft Hyper-V, cloud platforms (AWS, Azure, Google Cloud), and physical servers. The product supports advanced features including instant VM recovery, application-aware processing, storage snapshots integration, and cloud-native backup for modern hybrid IT environments. This documentation covers VBR version 13.0 and includes the User Guide, PowerShell Reference, Enterprise Manager REST API, Event Reference, and Cloud Connect documentation. The PowerShell module (`Veeam.Backup.PowerShell`) enables full automation of backup infrastructure management, job creation, and restore operations. The Enterprise Manager REST API provides HTTP-based programmatic access for multi-server environments and third-party integrations. ## PowerShell API ### Connect-VBRServer Establishes a connection to a Veeam Backup & Replication server, starting a PowerShell session for backup operations. Authentication supports current Windows user credentials, explicit username/password, or PSCredential objects. ```powershell # Connect to local server as current user Connect-VBRServer # Connect to remote server with credentials Connect-VBRServer -Server "192.168.1.100" -User "DOMAIN\Administrator" -Password "SecureP@ss" # Connect using PSCredential object $creds = Get-Credential Connect-VBRServer -Credential $creds -Server "backup-server.domain.local" -Port 9392 # Disconnect when done Disconnect-VBRServer ``` ### Add-VBRViBackupJob Creates a new VMware backup job to protect virtual machines. Requires specifying target VMs and optionally a backup repository, encryption settings, and job priority. ```powershell # Create backup job for Exchange servers $Repository = Get-VBRBackupRepository -Name "Backup Repository" $VMs = Find-VBRViEntity -Name "Exchange*" Add-VBRViBackupJob -Name "Exchange Backup" ` -BackupRepository $Repository ` -Entity $VMs ` -Description "Daily Exchange Server Backup" ` -HighPriority # Create encrypted backup job $Repository = Get-VBRBackupRepository -Name "Secure Repository" $VM = Find-VBRViEntity -Name "DatabaseServer" $Key = Get-VBREncryptionKey -Description "Production Key" Add-VBRViBackupJob -Name "Encrypted DB Backup" ` -BackupRepository $Repository ` -Entity $VM ` -EncryptionKey $Key ``` ### Get-VBRJob Retrieves backup, replication, file copy, and VM copy jobs from the Veeam database. Supports filtering by name with wildcard patterns. ```powershell # Get all jobs Get-VBRJob # Get specific jobs by name pattern Get-VBRJob -Name "Production*" # Get job and check its status $job = Get-VBRJob -Name "Daily Backup" $job | Select-Object Name, JobType, IsScheduleEnabled, ScheduleOptions ``` ### Start-VBRJob Starts a backup or replication job manually. Supports full backup mode, retry on failure, and chained job execution. ```powershell # Start job normally Get-VBRJob -Name "WebServer Backup" | Start-VBRJob # Force full backup Get-VBRJob -Name "Critical Systems" | Start-VBRJob -FullBackup # Start with retry and chained jobs $job = Get-VBRJob -Name "Database Backup" Start-VBRJob -Job $job -RetryBackup -StartChainedJobs -RunAsync # Start multiple jobs Get-VBRJob -Name "Production*" | Start-VBRJob -RunAsync ``` ### Set-VBRJobSchedule Configures job scheduling for daily, monthly, periodic, or chained execution patterns. ```powershell # Schedule daily at 11 PM on weekdays $job = Get-VBRJob -Name "Daily Backup" Set-VBRJobSchedule -Job $job -Daily -At "23:00" -DailyKind Weekdays # Schedule monthly on last Saturday $job = Get-VBRJob -Name "Monthly Archive" Set-VBRJobSchedule -Job $job -Monthly -At "02:00" ` -NumberInMonth Last -Days Saturday ` -Months January, April, July, October # Schedule every 6 hours $job = Get-VBRJob -Name "Frequent Backup" Set-VBRJobSchedule -Job $job -Periodicaly -FullPeriod 6 -PeriodicallyKind Hours # Chain job to run after another $primaryJob = Get-VBRJob -Name "Primary Backup" $secondaryJob = Get-VBRJob -Name "Secondary Backup" Set-VBRJobSchedule -Job $secondaryJob -After -AfterJob $primaryJob ``` ### Get-VBRBackup Returns backup metadata including all restore points for VMs processed by backup jobs. ```powershell # Get all backups Get-VBRBackup # Get specific backup by name Get-VBRBackup -Name "Exchange Backup" # Get VeeamZIP backups Get-VBRBackup -VeeamZIP # Get backup by ID Get-VBRBackup -Id "d6b08a78-f405-400a-bb02-a132cf1778fa" ``` ### Get-VBRRestorePoint Retrieves restore points (recovery points) from backups for use in restore operations. ```powershell # Get all restore points Get-VBRRestorePoint # Get restore points for specific VM $backup = Get-VBRBackup -Name "Production Backup" Get-VBRRestorePoint -Name "WebServer01" -Backup $backup # Get latest restore point Get-VBRBackup -Name "Daily Backup" | Get-VBRRestorePoint -Name "AppServer" | Sort-Object -Property CreationTime -Descending | Select-Object -First 1 # Get restore points from replica $replica = Get-VBRReplica -Name "DR Replica" Get-VBRRestorePoint -Backup $replica ``` ### Add-VBRBackupRepository Adds a backup repository to the infrastructure for storing backup files. Supports Windows, Linux, CIFS shares, deduplication appliances, and hardened repositories. ```powershell # Add Windows local repository $server = Get-VBRServer -Name "BackupServer01" Add-VBRBackupRepository -Name "Local Repo" ` -Server $server ` -Folder "D:\Backups" ` -Type WinLocal # Add Linux repository with immutability $linuxSrv = Add-VBRLinux -Name "192.168.1.50" -SSHUser "backup" -SSHPassword "P@ssw0rd" Add-VBRBackupRepository -Name "Hardened Repo" ` -Server $linuxSrv ` -Folder "/mnt/backups" ` -Type Hardened ` -EnableBackupImmutability ` -ImmutabilityPeriod 30 # Add SMB share repository $server = Get-VBRServer -Name "FileServer" $creds = Get-VBRCredentials -Name "BackupAdmin" Add-VBRBackupRepository -Type CifsShare ` -Name "NAS Repository" ` -Server $server ` -Folder "\\nas01\backups" ` -Credentials $creds ` -LimitConcurrentJobs ` -MaxConcurrentJobs 8 ``` ### Start-VBRRestoreVM Performs full VM restore to original or alternate location with options for staged restore, secure restore, and network remapping. ```powershell # Restore to original location $restorepoint = Get-VBRRestorePoint -Name "WebServer01" | Select-Object -First 1 Start-VBRRestoreVM -RestorePoint $restorepoint ` -ToOriginalLocation ` -Reason "Hardware failure recovery" ` -PowerUp:$true # Restore to different host and datastore $restorepoint = Get-VBRRestorePoint -Name "DBServer" $server = Get-VBRServer -Name "esx02.domain.local" $datastore = Find-VBRViDatastore -Server $server -Name "SAN_LUN_02" $pool = Find-VBRViResourcePool -Server $server Start-VBRRestoreVM -RestorePoint $restorepoint[0] ` -Server $server ` -Datastore $datastore ` -ResourcePool $pool ` -VMName "DBServer_Restored" ` -PowerUp:$true ` -NICsEnabled:$false # Secure restore with antivirus scan $restorepoint = Get-VBRRestorePoint -Name "FileServer" | Select-Object -First 1 Start-VBRRestoreVM -RestorePoint $restorepoint ` -ToOriginalLocation ` -EnableAntivirusScan ` -EnableEntireVolumeScan ` -VirusDetectionAction DisableNetwork ``` ### Start-VBRInstantRecovery Instantly boots a VM directly from backup storage for minimal downtime recovery. The VM runs from the backup file while changes are redirected to a specified datastore. ```powershell # Instant recovery to original ESXi host $backup = Get-VBRBackup -Name "Critical Servers" $restorepoint = Get-VBRRestorePoint -Backup $backup | Sort-Object -Property CreationTime -Descending | Select-Object -First 1 $server = Get-VBRServer -Type ESXi -Name "esx01.domain.local" Start-VBRInstantRecovery -RestorePoint $restorepoint ` -Server $server ` -PowerUp ` -NICsEnabled # Instant recovery to different location $restorepoint = Get-VBRRestorePoint -Name "AppServer" $server = Get-VBRServer -Name "esx-dr.domain.local" $pool = Find-VBRViResourcePool -Name "DR_Pool" $store = Find-VBRViDatastore -Name "DR_Datastore" Start-VBRInstantRecovery -RestorePoint $restorepoint[0] ` -VMName "AppServer_IR" ` -Server $server ` -ResourcePool $pool ` -Datastore $store ` -PowerUp:$true ` -NICsEnabled:$true ` -Reason "DR test" ` -RunAsync ``` ## Enterprise Manager REST API ### Authentication - Create Session Authenticates with the REST API using HTTP Basic authentication and obtains a session token for subsequent requests. ```bash # Step 1: Access API and get session endpoint curl -k -X GET "https://em-server:9398/api/" # Step 2: Create logon session with Basic auth (base64 encoded username:password) curl -k -X POST "https://em-server:9398/api/sessionMngr/?v=latest" \ -H "Authorization: Basic YWRtaW5pc3RyYXRvcjpQQHNzdzByZA==" \ -H "Content-Type: application/xml" # Response includes session token in X-RestSvcSessionId header # Use this token in all subsequent requests # Step 3: Logout when done curl -k -X DELETE "https://em-server:9398/api/logonSessions/{session-id}" \ -H "X-RestSvcSessionId: {your-session-token}" ``` ### GET /backupServers Retrieves all backup servers connected to Enterprise Manager. ```bash # Get list of backup servers curl -k -X GET "https://em-server:9398/api/backupServers" \ -H "X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj" \ -H "Accept: application/json" # Response (JSON): # { # "Refs": [ # { # "Links": [...], # "UID": "urn:veeam:BackupServer:a1b2c3d4-...", # "Name": "backup01.domain.local", # "Href": "https://em-server:9398/api/backupServers/a1b2c3d4-..." # } # ] # } ``` ### GET /jobs Returns all backup, replication, and copy jobs from connected backup servers. ```bash # Get all jobs curl -k -X GET "https://em-server:9398/api/jobs" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Get jobs with entity details curl -k -X GET "https://em-server:9398/api/jobs?format=Entity" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Query specific job types curl -k -X GET "https://em-server:9398/api/query?type=Job&filter=JobType==Backup" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" ``` ### GET /restorePoints Retrieves restore points for backups and replicas across all connected servers. ```bash # Get all restore points curl -k -X GET "https://em-server:9398/api/restorePoints" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Get restore points with full details curl -k -X GET "https://em-server:9398/api/restorePoints?format=Entity" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Get restore points for specific backup curl -k -X GET "https://em-server:9398/api/backups/{backup-id}/restorePoints" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" ``` ### GET /backups Returns backup metadata from all connected backup servers. ```bash # Get all backups curl -k -X GET "https://em-server:9398/api/backups" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Get specific backup details curl -k -X GET "https://em-server:9398/api/backups/{backup-id}" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Get child backups (for backup copy jobs) curl -k -X GET "https://em-server:9398/api/backups/{backup-id}/childbackups" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" ``` ### GET /repositories Lists all backup repositories in the infrastructure. ```bash # Get repository references curl -k -X GET "https://em-server:9398/api/repositories" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Get repository details curl -k -X GET "https://em-server:9398/api/repositories?format=Entity" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" ``` ### POST /jobs/{ID}?action=start Starts a backup or replication job via the REST API. ```bash # Start a job curl -k -X POST "https://em-server:9398/api/jobs/{job-id}?action=start" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Content-Type: application/xml" # Stop a running job curl -k -X POST "https://em-server:9398/api/jobs/{job-id}?action=stop" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Content-Type: application/xml" # Retry a failed job curl -k -X POST "https://em-server:9398/api/jobs/{job-id}?action=retry" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Content-Type: application/xml" ``` ### GET /backupSessions Retrieves backup job session history and status information. ```bash # Get all backup sessions curl -k -X GET "https://em-server:9398/api/backupSessions" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Get specific session details curl -k -X GET "https://em-server:9398/api/backupSessions/{session-id}" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" # Get task sessions for a backup session curl -k -X GET "https://em-server:9398/api/backupSessions/{session-id}/taskSessions" \ -H "X-RestSvcSessionId: {session-token}" \ -H "Accept: application/json" ``` ## Summary Veeam Backup & Replication provides comprehensive data protection through its PowerShell module and REST API. The PowerShell interface enables full automation of backup infrastructure management, including server connections (`Connect-VBRServer`), job creation (`Add-VBRViBackupJob`), scheduling (`Set-VBRJobSchedule`), and various restore operations (`Start-VBRRestoreVM`, `Start-VBRInstantRecovery`). Common workflows include creating scheduled backup jobs for VM protection, managing backup repositories, and performing instant recovery for rapid disaster recovery scenarios. The Enterprise Manager REST API extends management capabilities across multiple backup servers through HTTP endpoints. Integration patterns typically involve authenticating via Basic HTTP auth to obtain a session token, then using that token to query jobs, backups, restore points, and repositories. The API supports both XML and JSON response formats and enables third-party tools and orchestration platforms to interact with the Veeam infrastructure. For production deployments, always verify configurations against the official Veeam Help Center documentation and ensure the PowerShell module version matches your VBR installation.