Using PowerShell to Automate the Deployment of Veeam Agent for Microsoft Windows 2.0

Happy May Day everyone and well Happy 36th Birthday to me 😀

Now that the Veeam Agent for Microsoft Windows 2.0 is officially in its RTM build I am happy to share with the community some sample PowerShell that I have been working on. I’ll openly admit that I am not any where near a PowerShell or automation expert, in fact I very often to have to ask for assistance from friends or by Googling around for examples. With that automation is an intimidating and daunting task for most IT Professionals, but it does not have to be! My advice, is to take examples from around the community (like this example) and make it your own.

In this blog post I will provide you with everything that you need to be able to successfully automate the unattended deployment of the Veeam Agent for Microsoft Windows 2.0 by utilizing PowerShell.

Installation

In order to automate the installation we have to first have a known good configuration – to achieve this we’ll be utilizing the new configuration CLI / API tool that’s now available.

1.) Run the VAW setup on your server of choice – Next, Next, Next, Finish
2.) Apply your license
3.) Create your first VAW Backup

Next up, from an elevated command prompt cd to and run:

This will export your exact Agent configuration including the repository and all job settings to:

With this we now have our exact ‘Gold Agent’ configuration within an XML document. Since the configuration is in the XML format the file can be easily updated or changed as necessary without having to export the configuration again.

PowerShell Automation

Windows and PowerShell go together like Peanut Butter & Jelly (BTW, I love me a good PB&J) – So for this we’ll be using PowerShell to automate the deployment of our Windows Agent along with the license file and configuration.

Lets take a look at how to get this done.

You can head to the VeeamHUB @GitHub to grab a copy of the sample script that I am providing here.

The PowerShell utilizes a file structure of:

The PowerShell is broken up into 3 main areas:

1.) The first portion of the script performs the necessary checks and balancs to make sure that the directory structure is correct and in place.

2.) The second portion actually installs Veeam Agent for Microsoft Windows. You will notice the /silent and /accepteula switches.  This script example allows for a completely unattended and silent installation of the product. The $Process checks every 2 seconds to see if the installation is completed and when safe the Process “Veeam.EndPoint.Tray” is stopped so that we can install our license key and configuration file.

3.) The last portion of the script imports in the License File and Config.xml. You will need to run the License File import first as the Workstation and Server versions of the license file unlock additional capabilities like the Backup Cache, Cloud Connect Repository and Server Application Aware Image Processing.

Summary

This sample PowerShell allows for an unattended installation process for the Veeam Agent for Microsoft Windows. In a future blog post via the official Veeam.com/Blog I will show you how you can take this to the next level and utilize Group Policy or System Center Configuration Manager (SCCM) to completely automate the deployment process.

************************************************************************************************************************

DISCLAIMER:

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3 Comments

Add a Comment

Your email address will not be published. Required fields are marked *