A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hello there,
You could just use the Get Drive API.
You can query the user profile and get My site URL with PnP PowerShell as,
#Set Config Parameters
$AdminSiteURL="https://crescent-admin.sharepoint.com"
$UserAccount="******@crescent.com"#UPN
#Connect to the site
Connect-PnPOnline $AdminSiteURL -Interactive
#powershell to get onedrive for business url
Get-PnPUserProfileProperty
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer--