0

Sorry for the bad naming, I really can't wrap my head around exactly what I am asking for.

If I run this:

Get-MsolUser -UserPrincipalName [email protected] |
    select UserPrincipalName, {$_.StrongAuthenticationMethods.MethodType},
           {$_.StrongAuthenticationMethods.IsDefault}

I get back this:

[email protected]
{PhoneAppOTP, PhoneAppNotification, OneWaySMS, TwoWayVoiceMobile}
{False, True, False, False}

Is there any way for it to return me just the True MethodType from StrongAuthenticationMethods sub-object?

So a return like this:

[email protected]
PhoneAppNotification

I trying to avoid running a lengthy runtime script to loop through each user if I can return the data I need in a single pass.

1 Answer 1

2

Use a calculated property:

Get-MsolUser -UserPrincipalName '[email protected]' |
    Select-Object UserPrincipalName, @{n='AuthenticationMethod';e={
        $_.StrongAuthenticationMethods |
            Where-Object { $_.IsDefault } |
            Select-Object -Expand MethodType
    }}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.