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

Get auto update state powershell

Post by matteu »

Hello,

I think I already asked it on the past but I don't find it anymore.
Is it possible on Veeam M365 v7 to get the auto update state with powershell?

I know it was not on V6 and I would like to know if now it's possible or not.

General option -> Updates tab. How to query all the checkboxes here ? (supported or not supported method :) )

Thanks
Mildur
Product Manager
Posts: 10910
Liked: 2984 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Get auto update state powershell

Post by Mildur »

Hello Matteu

Unfortunately, it's not possible.

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

Re: Get auto update state powershell

Post by matteu »

Thanks for the answer
So Maybe it can be added on next versions :)
matteu
Veeam Legend
Posts: 886
Liked: 139 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get auto update state powershell

Post by matteu »

Hello,
I try it again 2 years later but don't find the cmdlet. There is no one?
I can accept an unsupported one :) I just would like to get the status of the 3 checkboxs in Menu -> general option -> Updates tab
Mildur
Product Manager
Posts: 10910
Liked: 2984 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Get auto update state powershell

Post by Mildur »

Hi Matteu,

Since v8, we have an API endpoint to retrieve update settings. But no PowerShell cmdlet.

Get Update Settings

Code: Select all

{
	"enableCheckForUpdates": true,
	"updateSettings": {
		"sendEmailOnAvailableUpdates": true,
		"installUpdatesAutomatically": true
		}
}
Best,
Fabian
Product Management Analyst @ Veeam Software
matteu
Veeam Legend
Posts: 886
Liked: 139 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get auto update state powershell

Post by matteu »

Thanks for your answer.
I will make the powershell code to get the data and post it :)
matteu
Veeam Legend
Posts: 886
Liked: 139 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get auto update state powershell

Post by matteu »

I finally get it from the database because I don't have other need from the rest API and this will not need to enter a password / token .
I'm aware this could change on next version and could not work anymore but maybe you will integrate it with native powershell cmdlet :)

Code: Select all

    # connexion settings
    $psqlPath = "C:\Program Files\PostgreSQL\15\bin\psql.exe"  # adapte selon ta version
    $dbName = "VeeamBackup365"
    $dbUser = "postgres"
    $outputFile = "c:\temp\UpdateManagement.txt"

    # query
    $query = "\copy (SELECT value FROM public.settings where key = 'UpdateProductConfig') TO '$outputFile'"

    #psql command
    & $psqlPath -U $dbUser -d $dbName -c $query | out-null

    $ResultFile = Get-content -Path $outputFile | ConvertFrom-Json
    Remove-Item -Path $outputFile 
    
    [PSCustomObject]@{
        CheckUpdatesAutomatically       = $ResultFile.CheckUpdatesAutomatically
        SendEmailOnUpdates              = $ResultFile.SendEmailOnUpdates
        InstallLiveUpdatesAutomatically = $ResultFile.InstallLiveUpdatesAutomatically
    }   
       
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests