I decided to write this simple example of how to use some basic functions of the Veeam PowerShell Extensions. This is by no means comprehensive, just an idea of some of the things that can be done if you don't have time to install Veeam Reporter Enterprise 3.5 yourself.

The Veeam PS Extensions are very similar to the VMware VI Toolkit, but don't require the VI Toolkit. With the Veeam PS Extensions you use PowerShell to connect to the Veeam Reporter Enterprise database, not vCenter. This gives the advantage of not putting any stress on vCenter and you also get access to all of the historical data in Veeam Reporter Enterprise.

Once you have everything installed, simply open the Veeam PowerShell Extensions shortcut and connect to the Veeam DB using the _Connect-VIServer command:

PS C:Documents and SettingsAdministratorDesktop> _Connect-VIServer

cmdlet _Connect-VIServer at command pipeline position 1

Supply values for the following parameters:

SQLInstance: localhostveeam

SQLDatabase: VeeamReporter

Now that you are connected, you can do some basic commands like _Get-VM

Name

PowerState

Num CPUs

Memory (MB)

----

----------

--------

-----------

WindowsServ01

PoweredOff

1

256

MSVM02

PoweredOff

1

256

MSVM011

PoweredOff

1

256

MSVM03_RUN

PoweredOff

1

256

MSVM04_TEST

PoweredOff

1

256

WindowsServ02_STA...

PoweredOff

1

256

MSVM03

PoweredOff

1

256

WindowsServ02

PoweredOff

1

256

MSVM04

PoweredOff

1

256

Windows Server Ho...

PoweredOff

1

256

DSL Linux

PoweredOff

1

256

To check what data set you're viewing, you can use the _Get-VRCurrentDate command:

PS C:Documents and SettingsAdministratorDesktop> _Get-VRCurrentDate

Tuesday, March 24, 2009 5:24:15 PM

If you want to connect to a different date, simply use the _Set-VRCurrentDate command and enter a date:

PS C:Documents and SettingsAdministratorDesktop> _Set-VRCurrentDate

cmdlet _Set-VRCurrentDate at command pipeline position 1

Supply values for the following parameters:

Date: 03.22.2009

To check that you're connected to the proper date, rung the _Get-VRCurrentDate command again:

PS C:Documents and SettingsAdministratorDesktop> _Get-VRCurrentDate

Sunday, March 22, 2009 12:00:00 AM

Now, executing the _Get-VM command will show different results, for that particular date:

Name

PowerState

Num CPUs

Memory (MB)

----

----------

--------

-----------

WindowsServ01

PoweredOn

1

256

MSVM02

PoweredOff

1

256

MSVM011

PoweredOff

1

256

MSVM03_RUN

PoweredOff

1

256

MSVM04_TEST

PoweredOff

1

256

WindowsServ02_STA...

PoweredOff

1

256

MSVM03

PoweredOff

1

256

WindowsServ02

PoweredOff

1

256

MSVM04

PoweredOff

1

256

Windows Server Ho...

PoweredOff

1

256

DSL Linux

PoweredOn

1

256

Notice that WindowsServ01 and DSL Linux are both listed as PoweredON for this date, they were listed as PoweredOff on the other date.

This is a VERY simplistic example just to show connecting to different dates/times in the database. If you want to learn more, please join our free courses PowerShell scripting for Veeam products and check PowerShell 4.0 guide for beginners.

GD Star Rating
loading...
Veeam PowerShell Extensions Example, 5.0 out of 5 based on 2 ratings

View posts related to category:

All Veeam Products Top List
Technology Bloggers on Air
  • RN

    Hi there,

    I am trying to find an easy way to obtain the “Next Run” times for a bunch of VMs on a particular ESX Host. What’s the best way to obtain this using PS?

    Using VI Client I can obtain the list of VMs on a host, however using the interface to find the next run times on VeeAm is quite time consuming. Any ideas?

    GD Star Rating
    loading...