How to fix this issues as I got the access token and powershell sdk of connnection through Graph. Still I am facing this error message.

Hritik Raushan 0 Reputation points
2024-12-26T11:18:49.6766667+00:00

PS C:\Users\Hritik Raushan> Get-MgUser

Get-MgUser : Expected comma, literal, or object. Was Eof: .

At line:1 char:1

  • Get-MgUser
  • 
        + CategoryInfo          : NotSpecified: (:) [Get-MgUser_List], ParserException
    
        + FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.GetMgUser_List
    
     
    
    
Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,375 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,664 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,708 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,665 questions
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 43,801 Reputation points
    2024-12-27T08:43:34.0466667+00:00

    Hi @Hritik Raushan

    I was able to reproduce your issue locally.

    User's image

    Retrieving the user list using a personal or guest account is currently not supported, please switch to a work account.

    User's image

    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.

    0 comments No comments

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.