IT Error Decoder

How to Fix Disconnect-MgGraph: not connected

Last reviewed

Error message

Disconnect-MgGraph : No application to sign out from.

This 'error' is harmless — it just means there was nothing to clean up.

What this error means

You called Disconnect-MgGraph but there's no active connection to disconnect from. This is a benign warning, not a real error.

Why this happens

Either the session was never connected, or it was already disconnected by a previous call or by session expiration.

Quick fix (for end users)

  • Ignore it. It doesn't break anything.
  • Wrap Disconnect-MgGraph in a try/catch if it bothers your script output.

Admin / engineer fix

  • Check before disconnecting.

    command
    if (Get-MgContext) { Disconnect-MgGraph }
  • Suppress the error explicitly.

    command
    Disconnect-MgGraph -ErrorAction SilentlyContinue

Step-by-step fix

  1. Check whether you actually need to call Disconnect-MgGraph.

  2. If you do, guard with Get-MgContext first.

Affected products

Microsoft.Graph PowerShell SDK

Common variations of this error

People also see these phrasings of the same problem:

  • No application to sign out from
  • Disconnect-MgGraph nothing to disconnect

Still broken? Try these

  • If a script keeps showing this on every run, it's calling Disconnect-MgGraph multiple times. Refactor to call it once at the end.
  • There's no functional impact — your data is fine.

Related errors

Related searches

  • disconnect-mggraph silently

Frequently asked questions

What does "Disconnect-MgGraph: not connected" mean?

You called Disconnect-MgGraph but there's no active connection to disconnect from. This is a benign warning, not a real error.

What causes "Disconnect-MgGraph: not connected"?

Either the session was never connected, or it was already disconnected by a previous call or by session expiration.

How do I fix "Disconnect-MgGraph: not connected"?

1. Check whether you actually need to call Disconnect-MgGraph. 2. If you do, guard with Get-MgContext first. Always test changes in a non-production environment first.

Browse more errors in Microsoft Graph PowerShell: Fix Microsoft Graph PowerShell errors. Insufficient privileges, invalid object ID, missing cmdlets, token problems, and more. Or paste your own error into the error decoder tool to find a match. You can also go back to the homepage to browse common errors by topic.