GET-ONEDRIVEURL: modify the command to allow other search criteria besides –email.
The nature of the migration I am working on requires samaccountname, which is only in AD.
The online Microsoft address is only in the Azure AD. However, userPrincipalName is in both.
Using just the userPrincipalName I can query AD for the attributes I need, and I can query Azure AD for the attributes I need. But the GET-ONEDRIVEURL command does not use userPrincipalName, it uses email.
That is why I am asking that you guys consider modifying the command to allow other search criteria besides –email.
Something like Get-AzureADUser does
Get-AzureADUser -Filter "userPrincipalName
Get-OneDriveURL has a logic error. It assumes that the tenant has Exchange Online. However, if org does not have Exchange online there is no email address. You guys are conflating the email address with the UPN. An account always has a UPN, but it does not have to have an email address. My client does not have Exchange Online, they are currently using O365 for OneDrive only. Having the Get-OneDriveURL command only tie to email address is very limiting.