question

39245906 avatar image
0 Votes"
39245906 asked Danstan-MSFT answered

Get admin info after admin conset process

Hi all
I'm using /adminconset endpoint in my application to get access to all organization users and it works fine for me.
But i want also to get email of user(admin) that give me that admin conset, but in callback i got only tenant id of organization and adminconset=true.
I think about reading all users with global admin role but there can be many admin and maybe some of them not active at all.
Anybody know any ways how to do it?
Thanks.

azure-ad-graph
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Are you doing a call like the one below? If not please attach the endpoint you are calling. Also note that Azure AD Graph is being deprecated and you should think of moving to MS Graph.

 https://login.microsoftonline.com/{tenant}/v2.0/adminconsent
         ?client_id=6731de76-14a6-49ae-97bc-6eba6914391e
         &scope=https://graph.microsoft.com/Calendars.Read https://graph.microsoft.com/Mail.Send
         &redirect_uri=http://localhost/myapp/permissions
         &state=12345


0 Votes 0 ·

Yes, i'm doing call as your wrote.

0 Votes 0 ·

1 Answer

Danstan-MSFT avatar image
0 Votes"
Danstan-MSFT answered

In your case, there is no way to access the admin who consented through an API. You can try going to Azure and checking the audit logs.

Go to Azure Portal>Azure Active Directory>Enterprise Applications>Your Application>Audit Logs

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.