hawk icon indicating copy to clipboard operation
hawk copied to clipboard

Get-MGDomain throwing error after authencation

Open RSOCKS opened this issue 2 years ago • 8 comments

Describe the bug A clear and concise description of what the bug is.

When running 'Start-HawkTenantInvestigation', after connection the Get-MGDomain cmdlet errors

image

This occurs after all authentication to the tenant with a Global Admin account and right after I specify the output direcotry

RSOCKS avatar Aug 31 '23 14:08 RSOCKS

I get the same error and and unable to run the report!

Disclaimer Do you agree with the above disclaimer? [Y] Yes [N] No [?] Help (default is "Y"): y

Please provide an output directory: C:\Hawk\New Get-MGDomain : One or more errors occurred. At line:81 char:9

  •     [string]$TenantName = (Get-MGDomain | Where-Object {$_.isDefa ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-MgDomain_List], AggregateException
    • FullyQualifiedErrorId : System.AggregateException,Microsoft.Graph.PowerShell.Cmdlets.GetMgDomain_List

PS C:\Windows\system32>

jonesconsulting avatar Sep 20 '23 23:09 jonesconsulting

You have to update the import modules to the latest version. This worked for me.

On Wed, Sep 20, 2023 at 7:17 PM jonesconsulting @.***> wrote:

I get the same error and and unable to run the report!

Disclaimer Do you agree with the above disclaimer? [Y] Yes [N] No [?] Help (default is "Y"): y

Please provide an output directory: C:\Hawk\New Get-MGDomain : One or more errors occurred. At line:81 char:9

   [string]$TenantName = (Get-MGDomain | Where-Object {$_.isDefa ...
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (:) [Get-MgDomain_List], AggregateException
    • FullyQualifiedErrorId : System.AggregateException,Microsoft.Graph.PowerShell.Cmdlets.GetMgDomain_List

PS C:\Windows\system32>

— Reply to this email directly, view it on GitHub https://github.com/T0pCyber/hawk/issues/110#issuecomment-1728543725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKEIJMSGIGBRYLDLCOZLQOLX3N2OZANCNFSM6AAAAAA4GERRKY . You are receiving this because you authored the thread.Message ID: @.***>

RSOCKS avatar Sep 20 '23 23:09 RSOCKS

Thanks for the quick reply, can you provide info on how to do this PLZ?

On Wed, Sep 20, 2023 at 5:38 PM RSOCKS @.***> wrote:

You have to update the import modules to the latest version. This worked for me.

On Wed, Sep 20, 2023 at 7:17 PM jonesconsulting @.***> wrote:

I get the same error and and unable to run the report!

Disclaimer Do you agree with the above disclaimer? [Y] Yes [N] No [?] Help (default is "Y"): y

Please provide an output directory: C:\Hawk\New Get-MGDomain : One or more errors occurred. At line:81 char:9

[string]$TenantName = (Get-MGDomain | Where-Object {$_.isDefa ...


- CategoryInfo : NotSpecified: (:) [Get-MgDomain_List],
AggregateException
- FullyQualifiedErrorId :

System.AggregateException,Microsoft.Graph.PowerShell.Cmdlets.GetMgDomain_List

PS C:\Windows\system32>

— Reply to this email directly, view it on GitHub https://github.com/T0pCyber/hawk/issues/110#issuecomment-1728543725, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKEIJMSGIGBRYLDLCOZLQOLX3N2OZANCNFSM6AAAAAA4GERRKY>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/T0pCyber/hawk/issues/110#issuecomment-1728557885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHL7QREQO44F6QNFYXAEYEDX3N463ANCNFSM6AAAAAA4GERRKY . You are receiving this because you commented.Message ID: @.***>

jonesconsulting avatar Sep 20 '23 23:09 jonesconsulting

I noticed I'm also receiving the error below after entering start-hawktenantinvestigation, not sure if this indicates another issue? the previously noted error appears to be resolved

PS C:\Windows\system32> start-hawktenantinvestigation Initializing Application Insights Checking for latest version online Found Version 3.1.0 Online Latest Version Installed Skipping Upgrade Testing Graph Connection Connecting to MGGraph using MGGraph Module Welcome to Microsoft Graph!

Connected via delegated access using 14d82eec-204b-4c2f-b7e8-296a70dab67e Readme: https://aka.ms/graph/sdk/powershell SDK Docs: https://aka.ms/graph/sdk/powershell/docs API Docs: https://aka.ms/graph/docs

NOTE: You can use the -NoWelcome parameter to suppress this message.

WARNING: Unable to find type [Microsoft.Graph.PowerShell.Authentication.Utilities.DependencyAssemblyResolver]. Select-MgProfile : The term 'Select-MgProfile' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:31 char:9

  •     Select-MgProfile -Name "v1.0"
    
  •     ~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Select-MgProfile:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Setting Up initial Hawk environment variable

jonesconsulting avatar Sep 21 '23 18:09 jonesconsulting

Can you provide any help on the following error PLZ I installed and reinstalled each of the items I was able to locate but still continue to receive this error [image: image.png]

On Wed, Sep 20, 2023 at 5:49 PM Tyrone Jones @.***> wrote:

Thanks for the quick reply, can you provide info on how to do this PLZ?

On Wed, Sep 20, 2023 at 5:38 PM RSOCKS @.***> wrote:

You have to update the import modules to the latest version. This worked for me.

On Wed, Sep 20, 2023 at 7:17 PM jonesconsulting @.***> wrote:

I get the same error and and unable to run the report!

Disclaimer Do you agree with the above disclaimer? [Y] Yes [N] No [?] Help (default is "Y"): y

Please provide an output directory: C:\Hawk\New Get-MGDomain : One or more errors occurred. At line:81 char:9

[string]$TenantName = (Get-MGDomain | Where-Object {$_.isDefa ...


- CategoryInfo : NotSpecified: (:) [Get-MgDomain_List],
AggregateException
- FullyQualifiedErrorId :

System.AggregateException,Microsoft.Graph.PowerShell.Cmdlets.GetMgDomain_List

PS C:\Windows\system32>

— Reply to this email directly, view it on GitHub https://github.com/T0pCyber/hawk/issues/110#issuecomment-1728543725, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKEIJMSGIGBRYLDLCOZLQOLX3N2OZANCNFSM6AAAAAA4GERRKY>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/T0pCyber/hawk/issues/110#issuecomment-1728557885, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHL7QREQO44F6QNFYXAEYEDX3N463ANCNFSM6AAAAAA4GERRKY . You are receiving this because you commented.Message ID: @.***>

jonesconsulting avatar Oct 03 '23 02:10 jonesconsulting

@jonesconsulting - Are you able to run "Connect-MGGraph" before running Hawk? Connect to the Graph before you run it and run "Get-MGGraph". It should return your domain list. If it doesn't return your domain or gives and error, then it might be a permission issue connecting to the graph.

Readme: https://aka.ms/graph/sdk/powershell SDK Docs: https://aka.ms/graph/sdk/powershell/docs API Docs: https://aka.ms/graph/docs

T0pCyber avatar Oct 03 '23 14:10 T0pCyber

I was able to connect, but received this error

[image: image.png] and HAWK still fails to run [image: image.png]

On Tue, Oct 3, 2023 at 8:26 AM Paul Navarro @.***> wrote:

@jonesconsulting https://github.com/jonesconsulting - Are you able to run "Connect-MGGraph" before running Hawk? Connect to the Graph before you run it and run "Get-MGGraph". It should return your domain list. If it doesn't return your domain or gives and error, then it might be a permission issue connecting to the graph.

Readme: https://aka.ms/graph/sdk/powershell SDK Docs: https://aka.ms/graph/sdk/powershell/docs API Docs: https://aka.ms/graph/docs

— Reply to this email directly, view it on GitHub https://github.com/T0pCyber/hawk/issues/110#issuecomment-1745088987, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHL7QRAAW6U5OCHLDNAVRCLX5QN77AVCNFSM6AAAAAA4GERRK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVGA4DQOJYG4 . You are receiving this because you were mentioned.Message ID: @.***>

jonesconsulting avatar Oct 03 '23 23:10 jonesconsulting

Uninstall-Module -Name MSOnline -RequiredVersion 1.1.183.80 Install-Module -Name MSOnline -RequiredVersion 1.1.183.66

Try after doing that. Should work now, this is how I fixed it. Found issue in another thread https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/2227

Gray-0men avatar Nov 04 '23 18:11 Gray-0men