-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Getting Started and Code Examples
Hello everybody,
At this topic, you can find useful stuff and links to code examples for the Veeam Backup & Replications PowerShell SDK.
What this thread is:
- a starting point for Backup & Replication PowerShell beginners
- a link collection to interesting code examples
- it is an ongoing project. You will likely find old outdated code that will maybe not work anymore as the PowerShell SDK was changed. But at least even with those you have a start point were to ask for an updated version.
What this thread isn´t:
- it is not complete and up to date (by design)
- it has no official support (it´s a community project)
- This is not a support forum, don´t expect any fast answers to problems. You can open a support ticket under http://www.veeam.com/support and the support team answers fast based on your maintenance contract SLAs.
If you find interesting topics, code examples or blog entry’s please "Like" it and add a link in an answer to this thread. If you want to discuss something, please use the linked thread or open a new one. We will add it from time to time to the index.
The Community lives from its people and their content. Please add your ready built scripts in a new topic and propose it here (new answer).
Hint for v9 Support:
With v9 many of the older scripts will work without problems. Maybe you have to change small things like Veeam added at a point “VI” or Hv” to the commands to separate VMware and Hyper-V commands. If you find a not working script please ask for an update at the individual thread. If you want to use a script that is not marked with *v9* at our newest Version, please test it and add a comment at the related thread if it is working or not. Thank you in advance.
Support
GitHub
How to start
Starting Jobs
Creating/Editing Jobs
Failover/Restore/Recovery
Backup Infrastructure
Scripts for special VMs
Remote Powershell and external connectivity (VMware Orchestrator)
Reporting stuff
At this topic, you can find useful stuff and links to code examples for the Veeam Backup & Replications PowerShell SDK.
What this thread is:
- a starting point for Backup & Replication PowerShell beginners
- a link collection to interesting code examples
- it is an ongoing project. You will likely find old outdated code that will maybe not work anymore as the PowerShell SDK was changed. But at least even with those you have a start point were to ask for an updated version.
What this thread isn´t:
- it is not complete and up to date (by design)
- it has no official support (it´s a community project)
- This is not a support forum, don´t expect any fast answers to problems. You can open a support ticket under http://www.veeam.com/support and the support team answers fast based on your maintenance contract SLAs.
If you find interesting topics, code examples or blog entry’s please "Like" it and add a link in an answer to this thread. If you want to discuss something, please use the linked thread or open a new one. We will add it from time to time to the index.
The Community lives from its people and their content. Please add your ready built scripts in a new topic and propose it here (new answer).
Hint for v9 Support:
With v9 many of the older scripts will work without problems. Maybe you have to change small things like Veeam added at a point “VI” or Hv” to the commands to separate VMware and Hyper-V commands. If you find a not working script please ask for an update at the individual thread. If you want to use a script that is not marked with *v9* at our newest Version, please test it and add a comment at the related thread if it is working or not. Thank you in advance.
Support
GitHub
How to start
Starting Jobs
Creating/Editing Jobs
Failover/Restore/Recovery
Backup Infrastructure
Scripts for special VMs
Remote Powershell and external connectivity (VMware Orchestrator)
Reporting stuff
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
Support
Powershell support through Veeam support organization is limited to fixing bugs and problems for specific commands. So, if you have problems with your script or need help to start with PowerShell, please use this Forum.
Veeam (non official) GitHub
A community project dedicated to experimental apps, tools, scripts etc around Veeam. Link: GitHub
Powershell support through Veeam support organization is limited to fixing bugs and problems for specific commands. So, if you have problems with your script or need help to start with PowerShell, please use this Forum.
Veeam (non official) GitHub
A community project dedicated to experimental apps, tools, scripts etc around Veeam. Link: GitHub
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
How to start
A good read is the
Veeam PowerShell Reference Guide *v9*
there you can find a list of all commands and Veeam powershell basics.
Also you can start with
Veeam Powershell Scripts - Beginners guide *UPDATE3* *v5-v9*
A good read is the
Veeam PowerShell Reference Guide *v9*
there you can find a list of all commands and Veeam powershell basics.
Also you can start with
Veeam Powershell Scripts - Beginners guide *UPDATE3* *v5-v9*
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
Starting Jobs
Andys scripting corner - Ultimate start job script *v6.1/6.5/v8*
Andys scripting corner - Post job command remote repository *v6/v6.1*
Start-VBRZip *6.1.0.204 => 6.1 + Hotfix1*
Andys scripting corner - Ultimate start job script *v6.1/6.5/v8*
Andys scripting corner - Post job command remote repository *v6/v6.1*
Start-VBRZip *6.1.0.204 => 6.1 + Hotfix1*
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
Creating/Editing Jobs
Andys scripting corner - Add VMs to job (v6) *v6/v6.1*
=> Enhancement: Adding ressource pools to Job *v6.5/v7*
Andys scripting corner - Add VM to Job/Create job and add VM *v6/v6.1/6.5* Not compatible with v7 because of new global credentials Manager.
Replica Job Creation example *v7*
Andys scripting corner - Find-VBRViEntity example / Find VM - Connect to vcenter and search for a VM example *v6.1*
Function for setting backup job options *6.1*
Setting Job Notification: SNMP/MAIL/Notes*v8* NEW
Network Mapping for Replica Jobs*v8* NEW
How to list all JobOption parameter/options? *v6* Maybe there are some new parameter with v6.1 and you have to add some lines like the existing ones.
Andys scripting corner - List / Set Scheduling Options *v6.1*
Schedule "After this job" *v7*
Set explicit VM VSS credentials (v6) *v6/v6.1/v6.5*
=> Update: Set Credentials at new v7 credentials manager *v7*
Other examples (read whole topic plz)
V7 Upgrade section:
Change Compression to v7 (new) optimal mode *v7
Errors:
Not able to change Repository in job per powershell (background information but no solution)*v6/v6.1*
Andys scripting corner - Add VMs to job (v6) *v6/v6.1*
=> Enhancement: Adding ressource pools to Job *v6.5/v7*
Andys scripting corner - Add VM to Job/Create job and add VM *v6/v6.1/6.5* Not compatible with v7 because of new global credentials Manager.
Replica Job Creation example *v7*
Andys scripting corner - Find-VBRViEntity example / Find VM - Connect to vcenter and search for a VM example *v6.1*
Function for setting backup job options *6.1*
Setting Job Notification: SNMP/MAIL/Notes*v8* NEW
Network Mapping for Replica Jobs*v8* NEW
How to list all JobOption parameter/options? *v6* Maybe there are some new parameter with v6.1 and you have to add some lines like the existing ones.
Andys scripting corner - List / Set Scheduling Options *v6.1*
Schedule "After this job" *v7*
Set explicit VM VSS credentials (v6) *v6/v6.1/v6.5*
=> Update: Set Credentials at new v7 credentials manager *v7*
Other examples (read whole topic plz)
V7 Upgrade section:
Change Compression to v7 (new) optimal mode *v7
Errors:
Not able to change Repository in job per powershell (background information but no solution)*v6/v6.1*
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
Backup Infrastructure
infrastructure deployment (Managed Server + Proxy)*v9*
Andys scripting corner - Show proxy / Set transport mode *v6/v6.1*
Andys scripting corner - Post job command remote repository *v6/v6.1*
vCenter powershell permissions check *v6/v6.1*
Create VBM From Scratch (external link) *v6/v6.1*
Post job script - Offload to existing tape backup Software - only if job is successfull *v6.5* with v7 there are native tape support and you can offload backups to a second destionation with "backup copy job", but it is still helpful if you still want to use your legacy backup tool for offloading veeam backup files to tape.
Find out the used Backup Job file system folder *v7*
infrastructure deployment (Managed Server + Proxy)*v9*
Andys scripting corner - Show proxy / Set transport mode *v6/v6.1*
Andys scripting corner - Post job command remote repository *v6/v6.1*
vCenter powershell permissions check *v6/v6.1*
Create VBM From Scratch (external link) *v6/v6.1*
Post job script - Offload to existing tape backup Software - only if job is successfull *v6.5* with v7 there are native tape support and you can offload backups to a second destionation with "backup copy job", but it is still helpful if you still want to use your legacy backup tool for offloading veeam backup files to tape.
Find out the used Backup Job file system folder *v7*
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
Scripts for special VMs
HOWTO: Backing up vCenter host issues *v6.5 and earlier* not needed for v7 which can backup vCenter consistent without problems
HOWTO: Backing up vCenter host issues *v6.5 and earlier* not needed for v7 which can backup vCenter consistent without problems
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
Remote Powershell and external connectivity (VMware Orchestrator)
Remote Powershell Example (with working forward authentication to SQL and password encryption) *v6.0/v6.1/v6.5/v7/v8* NEW
Old stuff (as idea pool):
Andys scripting corner - Orchestrator/ExternalSQL/vcenter *v6.1/v7* *UPDATED*
Andys scripting corner - Exit code to cmd handover
Using Find-VBRObject via PowerShell Remoting *v6.1*
Andys scripting corner - Post job command remote repository *v6/v6.1*
Post Job Script - Remote script without PS & ActiveDirectory *v5/v6/v6.1/v6.5/v7*
Post Job Cmd - Run only if job ends with success / warning *v6.5*
Select only latest .VBK File for external copy/backup to tape *v6.5*
Errors:
Backup & Replication together with external SQL database and remote powershell *v6.1*
Failed to login to "vcenter.demolab.an.veeam.de" by SOAP, port 443, user "vcenter\Administrator", proxy srv: port:0 *v6.1*
Remote Powershell Example (with working forward authentication to SQL and password encryption) *v6.0/v6.1/v6.5/v7/v8* NEW
Old stuff (as idea pool):
Andys scripting corner - Orchestrator/ExternalSQL/vcenter *v6.1/v7* *UPDATED*
Andys scripting corner - Exit code to cmd handover
Using Find-VBRObject via PowerShell Remoting *v6.1*
Andys scripting corner - Post job command remote repository *v6/v6.1*
Post Job Script - Remote script without PS & ActiveDirectory *v5/v6/v6.1/v6.5/v7*
Post Job Cmd - Run only if job ends with success / warning *v6.5*
Select only latest .VBK File for external copy/backup to tape *v6.5*
Errors:
Backup & Replication together with external SQL database and remote powershell *v6.1*
Failed to login to "vcenter.demolab.an.veeam.de" by SOAP, port 443, user "vcenter\Administrator", proxy srv: port:0 *v6.1*
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
Reporting stuff
Script to Verify VM's are backed up?
Powershell script to report daily backup sizes
PowerShell Veeam backup status report
Detail Failure Report
SysAdmin Modular Reporting (SAMReport) for Veeam
HowTo retrieve Backup Files from Veeam Jobs
List of all Jobs that are unsuccessfull at only last job run *v6.5*
List all Jobs, List all VMs in a Job, List of all VMs that are in Jobs *v8* NEW
Script to Verify VM's are backed up?
Powershell script to report daily backup sizes
PowerShell Veeam backup status report
Detail Failure Report
SysAdmin Modular Reporting (SAMReport) for Veeam
HowTo retrieve Backup Files from Veeam Jobs
List of all Jobs that are unsuccessfull at only last job run *v6.5*
List all Jobs, List all VMs in a Job, List of all VMs that are in Jobs *v8* NEW
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
placeholder
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
placeholder
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
placeholder
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
placeholder
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Code Examples and "How to start" *beta*
placeholder
-
- Enthusiast
- Posts: 44
- Liked: 4 times
- Joined: Jun 29, 2011 8:26 pm
- Full Name: James
- Contact:
Re: Code Examples and "How to start" *beta*
vCenter powershell permissions check : http://forums.veeam.com/viewtopic.php?f=26&t=10526 [AN] Coll stuff. Added to index ... Thank you!
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Getting Started and Code Examples
Hi everybody,
I added more links and the "Andys scripting corner - beginners guide".
CU Andy
I added more links and the "Andys scripting corner - beginners guide".
CU Andy
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Getting Started and Code Examples
-Checked some codes that are linked on this thread for v6.5 compatibillity and added *6.5* to the links.
-Enhanced Ultimate start job script
Hint: Most of the 6.1 code will work fine with 6.5 If you run into trouble with 6.5 start C:\Program Files\Veeam\Backup and Replication\Install-VeeamToolkit.ps1 once in a PS Admin window once. This will solve most likely your Problem.
The only commands you need to be carefull are scheduling commands, because we changed the possibilities and checkboxes in v6.5 .
-Enhanced Ultimate start job script
Hint: Most of the 6.1 code will work fine with 6.5 If you run into trouble with 6.5 start C:\Program Files\Veeam\Backup and Replication\Install-VeeamToolkit.ps1 once in a PS Admin window once. This will solve most likely your Problem.
The only commands you need to be carefull are scheduling commands, because we changed the possibilities and checkboxes in v6.5 .
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Getting Started and Code Examples
Added a link in the powershell remoting section
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Getting Started and Code Examples
Added another link to powershell remoteing section
Post Job Script - Remote script without PS & ActiveDirectory *v5/v6/v6.1/v6.5/v7* NEW
Post Job Cmd - Run only if job ends with success / warning *v6.5* NEW
Post Job Script - Remote script without PS & ActiveDirectory *v5/v6/v6.1/v6.5/v7* NEW
Post Job Cmd - Run only if job ends with success / warning *v6.5* NEW
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Getting Started and Code Examples
Updated a non working link. If you find more please answer to this thread.
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Getting Started and Code Examples
Added a link at external connectivity section with an example for "selecting only the latest vbk file for non Veeam based backup to tape"... In this case it was HP DP.
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Getting Started and Code Examples
Updated Replica Failover/Failback/Failback commit Code and linked it here.
-
- VP, Product Management
- Posts: 7077
- Liked: 1510 times
- Joined: May 04, 2011 8:36 am
- Full Name: Andreas Neufert
- Location: Germany
- Contact:
Re: Getting Started and Code Examples
Started v8 update of the scripts. Check again in the next days (maybe weeks) for frequent updates of this section.
Who is online
Users browsing this forum: No registered users and 8 guests