
You could get all OneDrive site ID through Graph API.
Here are steps:
1.There is a hidden list called "DO_NOT_DELETE_SPLIST_TENANTADMIN_ALL_SITES_AGGREGA" in the admin site. It stores a cached copy of aggregated site collections data from all contentDB. Get the ID of "DO_NOT_DELETE_SPLIST_TENANTADMIN_ALL_SITES_AGGREGA" list.
https://graph.microsoft.com/v1.0/sites/tenant-admin.sharepoint.com/lists
2.Get the TemplateId of OneDrive site.
https://graph.microsoft.com/v1.0/sites/tenant-admin.sharepoint.com/lists/c30bb5e8-6a11-4387-832c-bb80d76dc48e/items?$expand=fields
3.Get all OneDrive sites.
https://graph.microsoft.com/v1.0/sites/tenant-admin.sharepoint.com/lists/90403211-a51b-4a2b-8e83-a569011b63f7/items?$expand=fields&$filter=fields/TemplateId eq 21
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.