Solved

Retrieving Enterprise Manager information using powershell

  • 1 January 2022
  • 9 comments
  • 410 views

Userlevel 2

Hello,

 

First of all Happy New Year!

 

I have been working on a veeam implementation report using the AsBuiltReport framework created by Tim Carman @tpcarman see report here:

 

Project Report:

 

https://github.com/rebelinux/AsBuiltReport.Veeam.VBR

 

Sample Report:

 

https://technomyth.zenprsolutions.net/wp-content/uploads/2021/12/Veeam-VBR-As-Built-Report.html

 

Now the important thing, I would like to add to the report if the backup server is configured with an Enterprise Manager.

 

Does anyone know if there is a way in powershell to identify which Enterprise Manager the Backup server is connected to?

 

Thanks in advance!

icon

Best answer by DChiavari 14 January 2022, 18:16

View original

9 comments

Userlevel 2

Sorry, I’m a little late to the party, but I have a method in PowerShell that doesn’t require calling Invoke-SqlCmd cmdlet as it’s not installed by default in Windows Server (unless you also have SQL installed on the server or have installed manually).

 

Import-Module Veeam.Backup.PowerShell -WarningAction SilentlyContinue

[Veeam.Backup.Core.SBackupOptions]::GetEnterpriseServerInfo() | Select IsConnected, ServerName, Url | Format-List

 

Thanks!

Userlevel 7
Badge +7

Sorry, I’m a little late to the party, but I have a method in PowerShell that doesn’t require calling Invoke-SqlCmd cmdlet as it’s not installed by default in Windows Server (unless you also have SQL installed on the server or have installed manually).

 

Import-Module Veeam.Backup.PowerShell -WarningAction SilentlyContinue

[Veeam.Backup.Core.SBackupOptions]::GetEnterpriseServerInfo() | Select IsConnected, ServerName, Url | Format-List

 

Great @CptAmerica 😎👍🏼

Userlevel 4

Sorry, I’m a little late to the party, but I have a method in PowerShell that doesn’t require calling Invoke-SqlCmd cmdlet as it’s not installed by default in Windows Server (unless you also have SQL installed on the server or have installed manually).

 

Import-Module Veeam.Backup.PowerShell -WarningAction SilentlyContinue

[Veeam.Backup.Core.SBackupOptions]::GetEnterpriseServerInfo() | Select IsConnected, ServerName, Url | Format-List

 

Userlevel 7
Badge +7

Nice solution, thank you :thumbsup_tone3:

Userlevel 4
Badge

I wasn’t able to find a way, with Powershell, to check if a VBR server is managed by an Enterprise Manager… the only place where I could find this info is the VBR configuration database (SQL Server).

As already mentioned, interacting directly with the database is unsupported and generally not recommended.

That said, the following Powershell code should not do any harm :slight_smile: and just pull the Enterprise Manager info (if any) from the database.

#Query the SQL database to retrieve Enterprise Manager connection info (if any)
$info = Invoke-Sqlcmd -ServerInstance <YOUR_VBR_SQL_INSTANCE_HERE> -query "select value from [Veeambackup].[dbo].[Options] where name = 'EnterpriseServerInfo'"

#Parse and display the info (XML attributes / child nodes) obtained from the database
$([xml]$info.value).ChildNodes

Example output:

Note: if the VBR server is not managed by an Enterprise Manager server, the “EnterpriseServerInfo” row and data won’t be present at all.

Userlevel 5
Badge +1

You could leverage netstat or Get-NetTCPConnection to see the connections on port 9392. Exclude the hosts accessing the VBR server using the Veeam Backup & Replication Console from the output and be aware that the connection from the EM server to the VBR server is not permanent.

Userlevel 7
Badge +4

@jcolonfzenpr

I don’t know a way or method to get the enterprise manager with the help of the veeam Powershell Module.

You could get your answer from the vbr sql database if a EM is connected. And you can get also the FQDN. But that’s an unsupported method. 

Maybe oleg.feoktistov from veeam can help you in the R&D Forums. He is the real veeam powershell guru :sunglasses:

Userlevel 7
Badge +7

This are the REST API cmdlets, not Powershell :sunglasses:

As far as I know the Enterprise Manager has a REST API only and no Powershell interface...

Userlevel 7
Badge +5

Hi @jcolonfzenpr ,

this is the bible of cmdlets, check if can help you:

https://helpcenter.veeam.com/docs/backup/powershell/get-vbrserversession.html?ver=110

and this is the section for Enterprise Manager cmdlets:

https://helpcenter.veeam.com/docs/backup/em_rest/em_web_api_reference.html?ver=110

:grin:

Comment