# 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"