PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Get smtp configuration

Post by matteu »

Hello,

I had a function to get the SMTP configuration here :

Code: Select all

function Get-VeeamNotification
{
    Write-Host "$(Get-Date -Format HH:mm:ss) - SMTPSettings"

    $SMTP       = Get-VBRMailNotificationConfiguration
    $SMTPStatus = $SMTP.Enabled

    [PsCustomObject]@{
        Status          = $SMTPStatus
        Server          = if($SMTPStatus) {$SMTP.SmtpServer} else {"<N/A>"}
        Port            = if($SMTPStatus) {$SMTP.Port} else {"<N/A>"}
        SSL             = if($SMTPStatus) {$SMTP.SSLEnabled} else {"<N/A>"}
        #if SMTP enabled and Authentication required
        Account         = if($SMTPStatus -and $SMTP.AuthEnabled) {$SMTP.credentials.name} else {"<N/A>"}
        Sender          = if($SMTPStatus) {$SMTP.Sender} else {"<N/A>"}
        Recipient       = if($SMTPStatus) {$SMTP.Recipient} else {"<N/A>"}
        Subject         = if($SMTPStatus) {$SMTP.Subject} else {"<N/A>"}
        DailyReport     = if($SMTPStatus -eq $true) {$SMTP.DailyReportsTime.ToShortTimeString()} else {"<N/A>"}
        NotifyOnSuccess = if($SMTPStatus) {$SMTP.NotifyOnSuccess} else {"<N/A>"}
        NotifyOnWarning = if($SMTPStatus) {$SMTP.NotifyOnWarning} else {"<N/A>"}
        NotifyOnFailure = if($SMTPStatus) {$SMTP.NotifyOnFailure} else {"<N/A>"}
    }
    Write-Host "$(Get-Date -Format HH:mm:ss) --------------------"
}
It worked perfectly for V11.

Now there are some change with integration of modern authentication for google + M365 and I don't find new cmdlet.
I would like to know how to get these informations :

1) Get authentication used :
SMTP server / google gmail modern / M365 modern

2) For google modern :
Use custom application registration enabled or not
if enabled get application client ID + secret

3) For M365 modern
Use custom application registration enabled or not
if enabled get application client ID + Tenant ID

Thanks for your help
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get smtp configuration

Post by oleg.feoktistov »

Hi,

New authentication parameters for mail notifications are not yet supported in Powershell, but we have it noted for further releases.

Best regards,
Oleg
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get smtp configuration

Post by matteu »

Thanks for your answer
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests