Combine both : Get-MgBetaUser and Get-MgBetaReportAuthenticationMethodUserRegistrationDetail
Hi Guys I want to pull all user login details in Entra together ith MFA details for each user using the two modules to end up with an array for extracting a report like below. Kindly assist in joining data from the two modules, thank you.
$mfaData = Get-MgBetaReportAuthenticationMethodUserRegistrationDetail -Identity $user | Select-Object UserDisplayName,UserPrincipalName, UserType,IsAdmin,DefaultMfaMethod,IsMfaRegistered,IsMfaCapable,IsPasswordlessCapable, MethodsRegistered
$userData = @()
foreach ($user in $entraIdUsers) {
$entraIdUsers = Get-MgBetaUser -All -Property Id, DisplayDisplayNameName, UserPrincipalName, SignInActivity, CreatedDateTime, AccountEnabled
$userData += [PSCustomObject]@{
“Id” = $user.Id
“DisplayName” = $user.DisplayName
“UPN” = $user.UserPrincipalName
“CreatedDate” = $user.CreatedDateTime
“AccountEnabled” = $user.AccountEnabled
“LastSuccessfulSigninDate” = $user.SignInActivity.lastSuccessfulSignInDateTime
“LastInteractiveSignIn” = $user.SignInActivity.LastSignInDateTime
“LastNon_InteractiveSignIn” = $user.LastNonInteractiveSignInDateTime
“UserType” = $mfaData.UserType
“IsAdmin” = $mfaData.IsAdmin
“IsMfaRegistered” = $mfaData.IsMfaRegistered
“IsMfaCapable” = $mfaData.IsMfaCapable
“IsPasswordlessCapable” = $mfaData.IsPasswordlessCapable
“DefaultMfaMethod” = $mfaData.DefaultMfaMethod
“UserPreferredMethodForSecondaryAuthentication” = $mfaData.UserPreferredMethodForSecondaryAuthentication
“Methods registered” = $mfaData.MethodsRegistered -join “, “
}
}
Hi Guys I want to pull all user login details in Entra together ith MFA details for each user using the two modules to end up with an array for extracting a report like below. Kindly assist in joining data from the two modules, thank you. $mfaData = Get-MgBetaReportAuthenticationMethodUserRegistrationDetail -Identity $user | Select-Object UserDisplayName,UserPrincipalName, UserType,IsAdmin,DefaultMfaMethod,IsMfaRegistered,IsMfaCapable,IsPasswordlessCapable, MethodsRegistered
$userData = @()
foreach ($user in $entraIdUsers) {
$entraIdUsers = Get-MgBetaUser -All -Property Id, DisplayDisplayNameName, UserPrincipalName, SignInActivity, CreatedDateTime, AccountEnabled
$userData += [PSCustomObject]@{
“Id” = $user.Id
“DisplayName” = $user.DisplayName
“UPN” = $user.UserPrincipalName
“CreatedDate” = $user.CreatedDateTime
“AccountEnabled” = $user.AccountEnabled
“LastSuccessfulSigninDate” = $user.SignInActivity.lastSuccessfulSignInDateTime
“LastInteractiveSignIn” = $user.SignInActivity.LastSignInDateTime
“LastNon_InteractiveSignIn” = $user.LastNonInteractiveSignInDateTime
“UserType” = $mfaData.UserType
“IsAdmin” = $mfaData.IsAdmin
“IsMfaRegistered” = $mfaData.IsMfaRegistered
“IsMfaCapable” = $mfaData.IsMfaCapable
“IsPasswordlessCapable” = $mfaData.IsPasswordlessCapable
“DefaultMfaMethod” = $mfaData.DefaultMfaMethod
“UserPreferredMethodForSecondaryAuthentication” = $mfaData.UserPreferredMethodForSecondaryAuthentication
“Methods registered” = $mfaData.MethodsRegistered -join “, “
}
} Read More