# Export SMTP Client Submission (SMTPAuth) usage with PowerShell

As announced by Microsoft, SMTP Basic Authentication will be disabled in September 2025. While many are aware of this through the [Message Center](https://mc.merill.net/message/MC786329) or Microsoft's recent [blog post](https://techcommunity.microsoft.com/t5/exchange-team-blog/exchange-online-to-retire-basic-auth-for-client-submission-smtp/ba-p/4114750), this article focuses not on alternatives for applications and devices still using SMTP Basic Authentication, but rather on how to identify whether SMTP Auth is still in use within a tenant by using PowerShell. If you're a CSP looking to determine which of your customers still rely on this protocol, this guide is for you.

Microsoft provides a report within the Exchange Admin Center (EAC) to monitor [SMTP AUTH client usage](https://admin.exchange.microsoft.com/#/reports/smtpauthmailflowdetails). However, manually checking each tenant can be cumbersome, especially if you manage hundreds of tenants, as my current employer does.

Fortunately, the Exchange Online PowerShell module offers a cmdlet, `Start-HistoricalSearch`, that can yield similar results. Although the [documentation](https://learn.microsoft.com/en-us/powershell/module/exchange/start-historicalsearch?view=exchange-ps) doesn't explicitly mention a report type for SMTP Auth, some investigation into the network traffic sent by the EAC reveals an undocumented report type called `SmtpCSReport`.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1725462640655/f51bf76d-83dd-461a-94b4-1c7638bf5d2d.png align="center")

By utilizing this report type with the `Start-HistoricalSearch` cmdlet and adding the necessary parameters, you can initiate the export of the SMTP Auth usage report:

```powershell
Start-HistoricalSearch -ReportTitle "SMTPAuth" -ReportType "SmtpCSReport" -StartDate (Get-Date).AddDays(-89) -EndDate (Get-Date)
```

You can monitor the status of the report with the following command:

```powershell
Get-HistoricalSearch | where -Property ReportType -eq "SmtpCSReport"
```

Once the report is completed, the resulting file can be downloaded using the URL found in the `FileUrl` attribute. However, if your primary concern is simply identifying which customers are still using the soon-to-be-deprecated protocol, without needing specific user data or usage frequency, you can extract the relevant information directly from the `Rows` attribute without downloading the full report:

```plaintext
JobId                                SubmitDate          ReportTitle Status Rows
-----                                ----------          ----------- ------ ----
048e3455-dcf6-48ad-ad22-4d4a696f3fd5 28.08.2024 13:01:01 SMTPAuth    Done   8603
```

If you manage numerous customers, consider running these tasks in parallel or processing them in batches, as the `*-HistoricalSearch` commands can take a significant amount of time to complete. However, be aware that each time you connect to EXO, PowerShell loads the entire module for each customer or job. This can quickly consume a substantial amount of memory in your PowerShell session—something I discovered firsthand.
