Hi @Andy
You could use the following powershell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Web application URL and CSV File location Variables
$WebAppURL="https://intranet.crescent.com"
$CSVFile="C:\SitesList.csv"
#Get list of site collections in a web application powershell
Get-SPWebApplication $WebAppURL | Get-SPSite -Limit All | ForEach-Object {
New-Object -TypeName PSObject -Property @{
SiteName = $_.RootWeb.Title
Url = $_.Url
DatabaseName = $_.ContentDatabase.Name }
} | Export-CSV $CSVFile -NoTypeInformation
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in [our documentation][2] to enable e-mail notifications if you want to receive the related email notification for this thread. [2]: https://learn.microsoft.com/en-us/answers/support/email-notifications