I don't recall where I had found this, but it was helpful to see who was using OD4B in our tenant using Powershell.
#Specify tenant admin and URL
$User = "[email protected]"
#Configure Site URL and User
$SiteURL = "https://yoursite-my.sharepoint.com"
#Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.UserProfiles.dll"
$Password = Read-Host -Prompt "Please enter your password" -AsSecureString
$Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
#Bind to Site Collection
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Context.Credentials = $Creds
#Identify users in the Site Collection
$Users = $Context.Web.SiteUsers
$Context.Load($Users)
$Context.ExecuteQuery()
#Create People Manager object to retrieve profile data
$Output = "C:\Users\u531076\Desktop\Output.csv"
$Headings = "Name","Email","OneDrive URL","Phone","Job Title","Department"
$Headings -join "," | Out-File -Encoding default -FilePath $Output
$PeopleManager = New-Object Microsoft.SharePoint.Client.UserProfiles.PeopleManager($Context)
Foreach ($User in $Users)
{
$UserProfile = $PeopleManager.GetPropertiesFor($User.LoginName)
$Context.Load($UserProfile)
$Context.ExecuteQuery()
If ($UserProfile.Email -ne $null)
{
$UPP = $UserProfile.UserProfileProperties
Write-Host "Writing user data for " $UserProfile.DisplayName -ForegroundColor Green
$Properties = $UserProfile.DisplayName.Replace(",", ""), $UserProfile.Email, $UserProfile.PersonalUrl, $UPP.WorkPhone, $UPP.'SPS-JobTitle'.Replace(",", ""), $UPP.Department
$Properties -join "," | Out-File -Encoding default -Append -FilePath $Output
}
}
}
It'll output a CSV and will provide you with the OD4B address or the generic link. I haven't ventured into trying to precreate OD4B spaces for users who have generic paths yet.