ThomasKur / M365Documentation

Automatic Microsoft 365 Documentation to simplify the life of admins and consultants.
Other
300 stars 45 forks source link

AzureAD Insufficient Permissions #2

Closed danchemistruck closed 2 years ago

danchemistruck commented 3 years ago

I'm running: $doc1 = Get-M365Doc -Components AzureAD

And receiving the error:

Used application does not have sufficiant permission to access: https://graph.microsoft.com/beta/identity/identityProviders At C:\Program Files\WindowsPowerShell\Modules\M365Documentation\3.0.3\Internal\Helper\Invoke-DocGraph.ps1:51 char:13

I have conditional access policies to always require MFA for all Admin roles. There are also no pending admin consent requests in Enterprise Applications.

The Intune component runs fine though. Any suggestions why AzureAD won't work?

(Amazing tool, by the way!)

ThomasKur commented 3 years ago

Have you used the default application or have you created your own app registration?

hogendoorn commented 3 years ago

@ThomasKur i have the save error. I have been using your App registration

image

drazhargraig commented 3 years ago

@ThomasKur i have the save error. I have been using your App registration

image

I have found that when i run the connect-m365doc and it registers the app, i then need to close that PS window and open another one, and run it all again. It is like it hasnt finished registering in AzureAD while your current session is open

NRL-LEastham commented 3 years ago

@ThomasKur i have the save error. I have been using your App registration image

I have found that when i run the connect-m365doc and it registers the app, i then need to close that PS window and open another one, and run it all again. It is like it hasnt finished registering in AzureAD while your current session is open

This has worked perfectly for me, thanks @drazhargraig!

ThomasKur commented 3 years ago

Thank you for your support. I will try if I can add a delay or if it really requires a close/open of PowerShell which is really bad.

ThomasKur commented 2 years ago

The close/reopen is somehow always require. I assume this is due to the Azure AD Connection which was made to create the App registration. I added a warning to inform the users about this problem.