msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Add support for Service Principal sign-in for Get-MgReportApplicationSign

Open janegilring opened this issue 2 years ago • 3 comments

Currently (module version 1.9.6), when using Get-MgReportApplicationSign - it does not return information about Service Principal sign-ins. You have to specifically request them, by adding the “signInEventTypes/any(t:t eq ‘servicePrincipal’)” filter statement, as described in further detail here.

Would it be possible to either add the “signInEventTypes/any(t:t eq ‘servicePrincipal’)” filter statement by default when running Get-MgReportApplicationSign, or alternatively by a parameter (for example, -IncludeServicePrincipalSignIns)?

Or maybe it would make more sense to create a separate cmdlet? (for example, Get-MgReportServicePrincipalSignIn)

janegilring avatar May 13 '22 21:05 janegilring

It seems it is possible to retrieve the information using a filter on Get-MgAuditLogSignIn:

Get-MgAuditLogSignIn -Filter "signInEventTypes/any(t:t eq 'servicePrincipal') and AppId eq '$($Application.AppId)'"

Although, this was not very easy to discover. Maybe some pointers regarding service principal could be added to the cmdlet help and/or https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.reports/get-mgreportazureadapplicationsign?view=graph-powershell-beta ?

janegilring avatar May 13 '22 21:05 janegilring

@maisarissi to you for any doc updates that should be done here.

ddyett avatar Jun 16 '22 15:06 ddyett

If you are query more then 3000 Elements i always get "Get-MgAuditLogSignIn : A task was canceled."

weyCC81 avatar Mar 15 '23 14:03 weyCC81