Intune Powershell SDK

tarou chabi 731 Reputation points
2022-03-31T03:25:08.023+00:00

I'm accessing intune with Connect-MSGraph but I don't know how to disconnect the session.
Is there a way?

And, Connect-MgGraph has Disconnect-MgGraph.
How can I connect to intune using Connect-MgGraph?

Microsoft Security | Intune | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. Lu Dai-MSFT 28,516 Reputation points
    2022-03-31T09:17:53.777+00:00

    @tarou chabi Thanks for posting in our Q&A. Honestly, I'm not familiar with Powershell and only share some information that I tried in my environment.

    For Connect-MSGraph, it seems that there is no disconnet command under "microsoft.graph.intune" module. I used the following two command lines to find if there is any disconnect command, but no commands about disconnect.
    get-command -module microsoft.graph.intune
    connect-msgraph|get-member

    For Connect-MgGraph, it is suggested to install Microsoft.Graph module firstly and then use the command.
    https://learn.microsoft.com/en-us/graph/powershell/installation
    https://learn.microsoft.com/en-us/graph/powershell/get-started
    When you try to run Connect-MgGraph to connect to a tenant after disconnection, it will prompt you to go to a web page to sign in.
    Here is the screen shot showing the process:
    188711-image.png

    Hope it will give you some ideas.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

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