Forum Discussion

SystemEngineer's avatar
SystemEngineer
Steel Contributor
Jul 31, 2023

Get-MgProfile : The term 'Get-MgProfile' is not recognized as the name of a cmdlet, function, script

Hi everyone,

 

The cmdlet Get-MgProfile is no longer available after updating to v2.1.0 

Even the link is no longer available: https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.people/get-mguserprofile

 

What is the replacement Graph SDK cmdlet to get the existing Microsoft Graph PowerShell SDK connection profile name?

 

Thanks in advance.

  • LainRobertson's avatar
    LainRobertson
    Silver Contributor

    SystemEngineer 

     

    Before, you had both the v1.0 and beta endpoint commandlets in the same module and could switch between them using Select-MgProfile (and check with Get-MgProfile, etc.)

     

    Now, the v1.0 commandlets remain in the modules using the historical module names while the beta endpoint commandlets have been broken out of the previous modules and into their own standalone modules whose names are prefixed with Microsoft.Graph.Beta:

     

     

    The one exception is Microsoft.Graph.Authentication, which is common to both pathways.

     

    Now that the v1.0 and beta commandlets no longer coexist within the same module namespace, there is no reason to have the various *-MgProfile commandlets.

     

    Whether this is more or less convenient is a matter for debate but this is the new approach.

     

    Cheers,

    Lain

    • Elvir's avatar
      Elvir
      Copper Contributor

      Try changing the cmdlet to point to Beta. For example, if you call Get-MgAuditLogSignIn try to change it to Get-MgBetaAuditLogSignIn and it should work (most of the time).

  • Rajith's avatar
    Rajith
    Copper Contributor
    If you are running a code that has v1.0 commands and you upgraded your Graph SDK on the Hybrid worker server or the server from which you run the scheduled scripts, it may be necessary to comment out the “Select-MgProfile beta” line (depends on the code).

    If you want to access the beta endpoint commands and have upgraded your SDK to v2, you need to install the Graph Beta module as well. This way, you can use both modules (v2 & Beta) side by side without needing to switch profiles.

    Refer for more info - https://cloudiffic.com/select-mgprofile-is-not-recognized/
  • Martin710's avatar
    Martin710
    Copper Contributor

    SystemEngineer 

    I have the same problem and obviously NO ONE here is able to answer what you (and I) are asking.

    We do not have problem with beta version, and no, installing MS Graph beta does not solve the problem.

    If you have found a solution already then please share.

Resources