User Tools

Site Tools


obtener_usuarios_de_ms365_con_mfa_habilitado

This is an old revision of the document!


Estos scripts que llaman a MSOnline o alguno de los logins que preguntan desde una ventana web, hay que correrlos desde Windows.

getMsO365UsersMFAEnabled.ps1
# Install the MSOnline module if not already installed
Install-Module -Name MSOnline -Force
 
# Import the MSOnline module
Import-Module -Name MSOnline
 
# Connect to Azure AD using the MSOnline module
Connect-MsolService
 
# Get a list of users with MFA enabled
$users = Get-MsolUser -All | Where-Object {$_.StrongAuthenticationMethods.Count -gt 0}
 
# Output the user properties
$users | Select-Object UserPrincipalName, DisplayName | Export-Csv -Path "C:\temp\mfaTEC.csv"

Devuelve los UPN de las cuentas con StrongAuthenticationMethods > 0.

obtener_usuarios_de_ms365_con_mfa_habilitado.1686421878.txt.gz · Last modified: 2024/10/17 21:42 (external edit)