Skip to content

Show-UserMFA

SYNOPSIS

Shows a graph user's MFA methods.

SYNTAX

Show-UserMFA [[-UserObject] <PSObject[]>] [-TableStyle <String>] [-Font <String>] [-Xml <Boolean>]
 [-Open <Boolean>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Retrieves all registered authentication methods for one or more Entra ID users and displays them in a formatted table. Each method row includes type, summary details, and a pre-built deletion command for quick remediation.

Falls back to $Global:IRT_UserObjects if no -UserObject is passed.

EXAMPLES

EXAMPLE 1

Show-UserMFA
Displays MFA methods for the user in the global session.

EXAMPLE 2

Show-UserMFA -UserObject $User
Displays MFA methods for a specific user.

PARAMETERS

-UserObject

One or more Entra ID user objects to query. Falls back to global session objects if omitted. Accepts pipeline input.

Type: PSObject[]
Parameter Sets: (All)
Aliases: UserObjects

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-TableStyle

Excel table style. Defaults to IRT_Config.ExcelTableStyle.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $Global:IRT_Config.ExcelTableStyle
Accept pipeline input: False
Accept wildcard characters: False

-Font

Excel font name. Defaults to IRT_Config.ExcelFont.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $Global:IRT_Config.ExcelFont
Accept pipeline input: False
Accept wildcard characters: False

-Xml

Export raw XML alongside the Excel file. Defaults to IRT_Config.ExportXml.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $Global:IRT_Config.ExportXml
Accept pipeline input: False
Accept wildcard characters: False

-Open

Open the Excel file immediately after export. Default: $true.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: True
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

None. Results are displayed in the console and optionally exported to Excel.

NOTES

Credit to: https://thesysadminchannel.com/get-mfa-methods-using-msgraph-api-and-powershell-sdk/