Maintain control of your Microsoft 365 data
Post Reply
matteu
Veeam Legend
Posts: 874
Liked: 138 times
Joined: May 11, 2018 8:42 am
Contact:

Powershell get NATS configuration

Post by matteu »

Hello,
Is it possible to get the NATS server and the configuration with powershell ?
What is / are the server, TLS encryption enabled or not ?

I don't find any built in cmdlet for it and maybe you have something to share :)

Thanks for your help
Mildur
Product Manager
Posts: 10773
Liked: 2933 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Powershell get NATS configuration

Post by Mildur »

Hi Matteu

Not with Veeam cmdlets.
NATS is a third party application, therefore you can use other ways to retrieve the version.

Run the command on the machine with your NATS server:

Code: Select all

# get the path of nats-server.exe
sc.exe qc nats-server
# Retrieve the version
&"<path-to-nats-server.exe>" -v
Best,
Fabian
Product Management Analyst @ Veeam Software
matteu
Veeam Legend
Posts: 874
Liked: 138 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Powershell get NATS configuration

Post by matteu »

Hello,

Thanks for your answer.
That means I need to know which is my NATS server. This information is not store in Veeam configuration somewhere I can query with powershell ?
If it's local, it's ok with your command but if it's not, how can I retrive the NATS servers ?
Mildur
Product Manager
Posts: 10773
Liked: 2933 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Powershell get NATS configuration

Post by Mildur »

The NATS Server is specified in the config.xml file for your Veeam Backup for Microsoft 365 installation:
"C:\ProgramData\Veeam\Backup365\Config.xml"

Search for the JetStreamConnectionString entry. The hostname or IP address of the NATS Server will be shown after the "@" character.

Code: Select all

<Veeam>
  <Archiver>
    <Server Version="8.0" ProductVersion="8.1.2.180 P20250619" JetStreamConnectionString="nats://admin:**********@HOSTNAME:4222?passwordEncrypted" JetStreamReplicaCount="3" />
  </Archiver>
</Veeam>
Best,
Fabian
Product Management Analyst @ Veeam Software
matteu
Veeam Legend
Posts: 874
Liked: 138 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Powershell get NATS configuration

Post by matteu »

Thanks for your answer,
I finally find it too on the Veeam KB here : https://www.veeam.com/kb4742
However it's a different file than the one you specified. Could you explain me the difference maybe and if both will contains the same information about the NATS server ?
Mildur
Product Manager
Posts: 10773
Liked: 2933 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Powershell get NATS configuration

Post by Mildur »

Both Controller and Proxy Component need to access the NATS Server.

Config.xml belongs to the controller, Proxy.xml belongs to proxy.
The NATS configuration in both files should be identical.

Best,
Fabian
Product Management Analyst @ Veeam Software
matteu
Veeam Legend
Posts: 874
Liked: 138 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Powershell get NATS configuration

Post by matteu »

Thanks for your fast answer.

This is the powershell code I make based on your information :)

Code: Select all

#Path to Veeam 365 configuration file
$Path = "C:\ProgramData\Veeam\Backup365\Config.xml"
#Import file as XML
$XMLfile = [xml] (Get-Content -Path $Path)
#Get the XML section that contains the NATS server name
$String = $XMLfile.veeam.Archiver.Server.JetStreamConnectionString

# Use reget to get the server name between the character @ and :
if ($String -match '@([^:]+):') {
    $result = $matches[1]
}
[PSCustomObject]@{
	Server = $result
	Version = $XMLfile.veeam.Archiver.Server.ProductVersion
}
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest