I'm trying to use the Get-MgUserDrive command in PowerShell with the 'me' alias, full email address, and explicit user ID, but keep getting a 'User not found' error

Mo7Z 0 Reputation points
2024-06-12T17:00:19.47+00:00

I run the command below in powershell with using the Invoke-MgGraphRequest cmdlet.

Please find below the Powershell Command´s Screenshot and the error message.

User's image

Here is the Error msg:

User's image

What do you suggest? Gemini propose an Alternative Approach:

"If the issue persists, consider using the SharePoint Online cmdlets instead of the Microsoft Graph cmdlets. These are specifically designed to work with SharePoint Online."

Thanks,

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,724 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,428 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 3,765 Reputation points Microsoft Vendor
    2024-06-13T01:31:27.05+00:00

    Hi @Mo7Z

    This error is due to the lack of MS 365 license in your account.

    Please try purchasing or free trial MS 365 license for your tenant, then go to Azure AD and grant that license to the logged in user. As shown in the following picture.

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.