PowerShell script exchange
Post Reply
vitalii.fesh
Influencer
Posts: 12
Liked: 4 times
Joined: May 29, 2024 2:47 pm
Full Name: Vitalii Feshchenko
Contact:

Get Proxy date-time

Post by vitalii.fesh »

We are developing a script to retrieve information about the proxy and ensure that their date and time are synced with the VBR. I'm looking into the possibility of accomplishing this using the Veeam PowerShell module. Optionally, it might be retrieving the time server settings of the proxy for verification.

Any assistance in this matter would be greatly appreciated.
Mildur
Product Manager
Posts: 10110
Liked: 2696 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Get Proxy date-time

Post by Mildur » 1 person likes this post

Hi Vitalli

I don't think we have such a method in the PowerShell module. I can't see it in the official cmdlets.
Have you considered to use Get-Date?

Probably the challenge is to have the command run at the same exact moment on all proxies to have an accurate output.
One proxy may run the command a few seconds later which already makes the verification difficult.

Best,
Fabian
Product Management Analyst @ Veeam Software
oleg.feoktistov
Veeam Software
Posts: 2015
Liked: 671 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get Proxy date-time

Post by oleg.feoktistov » 1 person likes this post

Hi Vitalii,

We don't keep info on managed servers' datetimes in VBR database. You'd have to use either powershell remoting or wmi cmdlets to get it on a remote server.

Best regards,
Oleg
vitalii.fesh
Influencer
Posts: 12
Liked: 4 times
Joined: May 29, 2024 2:47 pm
Full Name: Vitalii Feshchenko
Contact:

Re: Get Proxy date-time

Post by vitalii.fesh »

Thank you, everyone. I will proceed with the regular method.

Regarding the Veeam version on Proxies, is it possible to retrieve this information using the PowerShell module?

I discovered a method to get all components, but I couldn't find a way to obtain a general version. Here’s what I have so far:

$proxyHost = $proxy.Server.GetPhysicalHost()
$proxyHost.GetComponents()
david.domask
Veeam Software
Posts: 2367
Liked: 560 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get Proxy date-time

Post by david.domask »

Hi Vitalii,

A proxy in this case is best understood as the collection of the Veeam Components installed (transport, deployment, etc) installed on it rather than some specific single binary version. So you will check the version on those Components returned by GetComponents().
David Domask | Product Management: Principal Analyst
vitalii.fesh
Influencer
Posts: 12
Liked: 4 times
Joined: May 29, 2024 2:47 pm
Full Name: Vitalii Feshchenko
Contact:

Re: Get Proxy date-time

Post by vitalii.fesh » 1 person likes this post

Thank you for answering, David.
vitalii.fesh
Influencer
Posts: 12
Liked: 4 times
Joined: May 29, 2024 2:47 pm
Full Name: Vitalii Feshchenko
Contact:

Re: Get Proxy date-time

Post by vitalii.fesh » 1 person likes this post

I ended up with this code below, which seeks the latest component version and parses it:

$proxyHost = $proxy.Server.GetPhysicalHost()
$ProxyComponents = $proxyHost.GetComponents()
$ProxyVersionRaw = $ProxyComponents | Select-Object -ExpandProperty Version | Sort-Object { [version]$_ } -Descending | Select-Object -First 1
$ProxyVersion = "{0}.{1}.{2}.{3}" -f $ProxyVersionRaw.Major, $ProxyVersionRaw.Minor, $ProxyVersionRaw.Build, $ProxyVersionRaw.Revision
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests