Views:

Prerequisites

  • The subscription should contain Exchange Online Plan 1 (Microsoft 365 essentials, business standard, standard premium) or Exchange Online Plan 2 (O365 E1, E3, or E5).
  • The Microsoft 365 account should be GLOBAL ADMIN.
  • Add a user that you want to use in the SMTP setting and assign a license.
  • PowerShell version 5.1 or higher.

Steps

  1. Open PowerShell as an Administrator.
  2. Set the execution policy for cloud CMDLets and accept the change.

    Set-ExecutionPolicy RemoteSigned

    Set the execution policy

  3. Install Powershell Exchange Online Management module and use -Allowclobber to allow update and -Force:

    Install-Module ExchangeOnlineManagement -AllowClobber -Force

    Install Powershell Exchange Online Management module

  4. Connect to ExchangeOnlineManagement module:

    Connect-ExchangeOnline

    Connect to ExchangeOnlineManagement

  5. Check the status of the tenant policy for SMTP:

    Get-TransportConfig | Select *smtp*

    check status

    If the property "SmtpClientAuthenticationDisabled" is true, it means SMTP Client Authentication is disabled globally on tenant.

  6. Query the exact property for the user that added in required condition step 3:

    Get-CASMailbox -identity [user_email]

    Query exact property for the user

    "SmtpClientAuthenticationDisabled" is null, so SMTP Auth is taking the global configuration which means Disabled.

  7. Enable SMTP Auth for this user (Set "SmtpClientAuthenticationDisabled" as false):

    Set-CASMailbox -Identity [user_email] -SmtpClientAuthenticationDisabled:$false

  8. Execute the command to check the properly:

    Enable SMTP Auth

  9. Log in to the Apex Central console, and go to Detections > Notifications > Notification Method Settings.
  10. Set SMTP Server Settings as the following:
    Server FQDN or IP address: smtp.office365.com
    Port: 587
    Sender email address: [user_email]
    Check Enable ESMTP
    User name: [user_email]
    Authentication: Login
    Check User SSL/TLS/encryption
    

    Enable SMTP Auth

     
    You may encounter the error when installExhangeOnline module on Win 2016 or older version:

    error

    Please run the following powershell command first:

    [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

    run powershell command

     
  1. Sign in to your Google Account.
  2. Go to Security > Sign in to Google.
  3. Enable 2-Step Verification.

    enable 2fa

  4. Enable App passwords.

    Enable App passwords

    App passwords

  5. Log in to the Apex Central console, and go to Detections > Notifications > Notification Method Settings.
  6. Set SMTP Server Settings as the following:
    Server FQDN or IP address: smtp.gmail.com
    Port: 587
    Sender email address: [user_email]
    Check Enable ESMTP
    User name: [user_email]
    Password: the app password generated in step 4
    Authentication: Login
    Check User SSL/TLS/encryption
    

    Set SMTP Server Settings