Get-MGDomain throwing error after authencation
RSOCKS opened this issue · 8 comments
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>
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 - 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
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
microsoftgraph/msgraph-sdk-powershell#2227