PowerShell script exchange
Post Reply
Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Getting Started and Code Examples

Post by Andreas Neufert » Sep 05, 2012 11:01 am 3 people like this post

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

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:02 am

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

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:03 am

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*

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:04 am



Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:11 am

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*

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:13 am

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



Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:16 am

Failover/Restore/Recovery

Failover/Failback/Failback commit *v7*

File Restore Example *v7*

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:17 am

placeholder

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:40 am

placeholder

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:41 am

placeholder

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:42 am

placeholder

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Code Examples and "How to start" *beta*

Post by Andreas Neufert » Sep 05, 2012 11:44 am

placeholder

jcwuerfl
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*

Post by jcwuerfl » Sep 05, 2012 2:22 pm 2 people like this post

vCenter powershell permissions check : http://forums.veeam.com/viewtopic.php?f=26&t=10526 [AN] Coll stuff. Added to index ... Thank you!

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » Sep 12, 2012 2:30 pm

Hi everybody,

I added more links and the "Andys scripting corner - beginners guide".

CU Andy

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » Jan 09, 2013 8:45 pm 1 person likes this post


Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » Feb 20, 2013 10:38 pm

-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 .

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » May 13, 2013 9:04 am

Added a link in the powershell remoting section

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » May 13, 2013 9:22 am

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

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » Jun 17, 2013 10:10 am

Updated a non working link. If you find more please answer to this thread.

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » Jul 29, 2013 6:41 am

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.

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » Sep 19, 2014 11:20 am

Updated Replica Failover/Failback/Failback commit Code and linked it here.

Andreas Neufert
Veeam Software
Posts: 3634
Liked: 639 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Getting Started and Code Examples

Post by Andreas Neufert » Feb 25, 2015 5:25 pm

Started v8 update of the scripts. Check again in the next days (maybe weeks) for frequent updates of this section.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests