Here are three methods to get external sharing report in the SharePoint.
1.Go to a SharePoint Online site -> Click on the Settings gear -> Site usage -> Sharing with external users -> Run report.

2.Go to Microsoft 365 admin center -> Compliance -> Aduit -> Classic search -> Set Date and time range (Audit supports searching data within six months) -> Choose Activities like following pictures show.


3.Using PnP PowerShell.
#Parameter
$Domain = "tenantname"
$CSVFile = "C:\Temp\ExternalSharing.csv"
#Frame Tenant URL and Tenant Admin URL
$TenantURL = "https://$Domain.SharePoint.com"
$TenantAdminURL = "https://$Domain-Admin.SharePoint.com"
#Delete the Output report file if exists
If (Test-Path $CSVFile) { Remove-Item $CSVFile }
#Connect to Admin Center
Connect-PnPOnline -Url $TenantAdminURL -Interactive
#Get All Site collections with External sharing enabled - Filter BOT and MySite Host
$Sites = Get-PnPTenantSite -Filter "Url -like '$TenantURL'" | Where {$_.SharingCapability -ne "Disabled"}
#Iterate through all site collections
$Sites | ForEach-Object {
Write-host "Getting External Users of Site:"$_.URL -f Yellow
#Connect to each site collection
Connect-PnPOnline -Url $_.URL -Interactive
$ExternalUsersData = @()
#Get all External Users of the site collection
$ExternalUsers = Get-PnPUser | Where {$_.LoginName -like "*#ext#*" -or $_.LoginName -like "*urn:spo:guest*"}
Write-host "`tFound '$($ExternalUsers.count)' External users" -f Green
#Collect Data
ForEach($User in $ExternalUsers)
{
$ExternalUsersData += New-Object PSObject -Property ([ordered]@{
SiteName = $_.Title
SiteURL = $_.URL
UserName = $User.Title
Email = $User.Email
})
}
#Export Documents Inventory to CSV
$ExternalUsersData | Export-CSV $CSVFile -NoTypeInformation -Append
}
Write-host "External Users Report Generated Successfully!" -f Magenta
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 to enable e-mail notifications if you want to receive the related email notification for this thread.