locked
Authenticate to Microsoft Graph the same way that Connect-MSGraph does RRS feed

  • Question

  • I've been reviewing Microsoft Graph documentation on how to to get an access token for the Microsoft Graph API, but I can't figure out how to accomplish authentication in the same way that the Cmdlet "Connect-MSGraph" or Connect-AzureAD or Connect-MSOnline does.

    Those Cmdlets take credentials then authenticate to Office365/Azure with them. As long as the user has the right access level, the other Cmdlets within the module will work.

    I looked at using the Microsoft.Graph PowerShell module (Connect-MgGraph), but I have to do this process of copy and pasting a URL from the console to my browser then copying and pasting a code from the console into the page in the browser and and so on whenever I want to use Connect-MgGraph. That seems like a ridiculously inconvenient thing to do every time a tech in my department runs this script.

    Wednesday, October 28, 2020 8:48 PM

Answers

  • We recommend that you post questions about MSGraph in the MSGraph forum.  I also suggest using your search engine to find the many examples of how to do this.

    Below is an example of what you will find.

    ms graph access token powershell - Google Search


    \_(ツ)_/

    • Marked as answer by EricR-82 Thursday, October 29, 2020 2:52 PM
    Wednesday, October 28, 2020 9:37 PM

All replies

  • We recommend that you post questions about MSGraph in the MSGraph forum.  I also suggest using your search engine to find the many examples of how to do this.

    Below is an example of what you will find.

    ms graph access token powershell - Google Search


    \_(ツ)_/

    • Marked as answer by EricR-82 Thursday, October 29, 2020 2:52 PM
    Wednesday, October 28, 2020 9:37 PM
  • The first page of search results don't contain any information on what I would like to accomplish. They all involve the device code method that the Microsoft.Graph PowerShell module uses, certificate based or  client secret. Not much help unfortunately.

    I will find another forum.

    Thursday, October 29, 2020 2:52 PM
  • The very first item on the list was the eact answer to your question.  You have to carefully read all articles and also have learned the technology y7ou are trying to work with.

    Microsoft Graph API with PowerShell | How (pipehow.tech)


    \_(ツ)_/

    Thursday, October 29, 2020 9:38 PM