Skip to content

Connect-MgGraph fails without error if specifying a nonexisting tenantid #492

Closed

Description

Connect-MgGraph fails silently/ without error when called with a nonexisting tenantid / verified domain.

PS C:\Windows\System32> Microsoft.Graph.Authentication\Connect-MgGraph -TenantId 'thisdomaindoesnotexist.com' -Scopes 'User.Read.All'
PS C:\Windows\System32>

Modules versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     1.2.0                 Microsoft.Graph.Authentication      {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext}
Script     1.2.0                 Microsoft.Graph.Users               {Get-MgUser, Get-MgUserCreatedObject, Get-MgUserCreatedObjectByRef, Get-MgUserDirectReport}
Script     0.9.1                 Microsoft.Graph.Users.Calendar      {Get-MgUserCalendar, Get-MgUserCalendarEvent, Get-MgUserCalendarEventAttachment, Get-MgUserCalendarEventCalendar}
Manifest   7.0.0.0               Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty}
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object}
Script     2.1.0                 PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler}

AB#6944

Activity

  1. peombwa commented on Jan 6, 2021

    @peombwa
    Member

    Olav Rønnestad Birkeland (@o-l-a-v) Thanks for bringing this to our attention. This is indeed a bug that was introduced with this change https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Authentication/Authentication/Cmdlets/ConnectMgGraph.cs#L141.

    We will fix this in the next release.

  2. ghost removed on Jan 6, 2021
  3. added this to the 1.3.0 milestone on Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions