Hi @Torben Andersen
Thanks for your back.
Based on my tests, to get the unlicensed OneDrive account URLs, you can use PnP PowerShell (Get-PnPUserProfileProperty) via specifying user's email accounts in .csv file.
The following image is the .csv file of my sample. You may list user accounts that be removed licenses in a .csv file.
Then run the code like below as a SharePoint admin. Please note, you need to replace "domain" with yours.
#Parameters
$SiteURL = "https://domain-admin.sharepoint.com"
$CSVFile = "C:\Users\test2\Desktop\UserAccount.csv"
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
#Get the data from CSV file
$CSVData = Import-CSV $CSVFile
$Counter =1
#Loop through each Row in the CSV file and upload file to SharePoint
ForEach($Row in $CSVData)
{
Get-PnPUserProfileProperty -Account $Row.useraccount -Properties 'PersonalUrl'
$Counter++
}
Then you will get the URLs like following image.
For more, please refer to this link: https://learn.microsoft.com/en-us/sharepoint/list-onedrive-urls
You can also export reports via going to SharePoint Admin Center. Click Reports > OneDrive accounts, go to Unlicensed OneDrive accounts section, then click "Download report". Please note, the accounts listed in this report are updated weekly, have been unlicensed for more than 90 days.
The reference: https://learn.microsoft.com/en-us/sharepoint/unlicensed-onedrive-accounts
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.