<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>azure powershell mfa settings Archives - the Sysadmin Channel</title>
	<atom:link href="https://thesysadminchannel.com/tag/azure-powershell-mfa-settings/feed/" rel="self" type="application/rss+xml" />
	<link>https://thesysadminchannel.com/tag/azure-powershell-mfa-settings/</link>
	<description>Documenting My Life as a System Administrator</description>
	<lastBuildDate>Thu, 22 Oct 2020 00:29:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
<site xmlns="com-wordpress:feed-additions:1">144174110</site>	<item>
		<title>Get MFA Status For Azure/Office365 Users Using Powershell</title>
		<link>https://thesysadminchannel.com/get-mfa-status-for-azure-office365-users-using-powershell/</link>
					<comments>https://thesysadminchannel.com/get-mfa-status-for-azure-office365-users-using-powershell/#comments</comments>
		
		<dc:creator><![CDATA[Paul Contreras]]></dc:creator>
		<pubDate>Thu, 21 Feb 2019 05:14:06 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Office365]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[azure mfa powershell]]></category>
		<category><![CDATA[azure mfa registration report]]></category>
		<category><![CDATA[azure mfa reports]]></category>
		<category><![CDATA[azure mfa status powershell]]></category>
		<category><![CDATA[azure powershell mfa settings]]></category>
		<category><![CDATA[get-azureaduser mfa status]]></category>
		<category><![CDATA[get-msoluserbystrongauthentication]]></category>
		<category><![CDATA[how to check if mfa is enabled in office 365]]></category>
		<category><![CDATA[office 365 mfa report]]></category>
		<category><![CDATA[office 365 mfa status powershell]]></category>
		<category><![CDATA[powershell mfa status]]></category>
		<guid isPermaLink="false">https://thesysadminchannel.com/?p=1400</guid>

					<description><![CDATA[<p>If you&#8217;ve recently deployed MFA (Multi-Factor Authentication) in Office365/ Azure you may find that there is no easy way to report who has MFA enabled, and more importantly, which of your administrators don&#8217;t have MFA enabled. I ran across a&#8230; <a href="https://thesysadminchannel.com/get-mfa-status-for-azure-office365-users-using-powershell/" class="more-link">Continue Reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a href="https://thesysadminchannel.com/get-mfa-status-for-azure-office365-users-using-powershell/">Get MFA Status For Azure/Office365 Users Using Powershell</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;ve recently deployed MFA (Multi-Factor Authentication) in Office365/ Azure you may find that there is no easy way to report who has MFA enabled, and more importantly, which of your administrators don&#8217;t have MFA enabled.  I ran across a problem that I needed to solve so I turned to Powershell for my solution.  Therefore, I created a script to get MFA status using Powershell.</p>
<p><em>Here we will assume you have the correct permissions to access the MSOL service and the email address and userprincipalname are the same</em></p>
<h2>Get MFA Status Using Powershell</h2>
<pre class="brush: powershell; title: ; notranslate">

Function Get-AzureMFAStatus {
&lt;#
.Synopsis
    This will get the Multi-factor authentication status of your users and determine which of them or not are admins.
    For updated help and examples refer to -Online version.
 

.DESCRIPTION
    This will get the Multi-factor authentication status of your users and determine which of them or not are admins.
    For updated help and examples refer to -Online version.


.NOTES   
    Name: Get-AzureMFAStatus
    Author: theSysadminChannel
    Version: 1.0
    DateCreated: 2019-Feb-08


.LINK
    https://thesysadminchannel.com/get-mfa-status-for-azure-office365-users-using-powershell -
#&gt;

    [CmdletBinding(DefaultParameterSetName=&quot;Default&quot;)]
    param(
        [Parameter(
            Position  = 0,
            Mandatory = $false,
            ValueFromPipeline =$true,
            ValueFromPipelineByPropertyName=$true,
            ParameterSetName = &quot;UserPrincipalName&quot;
        )]
        [string[]]   $UserPrincipalName,


        [Parameter(
            Mandatory         = $false,
            ValueFromPipeline = $false,
            ParameterSetName  = &quot;ResultList&quot;
        )]
        [int]        $MaxResults = 2000,


        [Parameter(
            Mandatory         = $false,
            ValueFromPipeline = $false,
            ParameterSetName  = &quot;ResultList&quot;
        )]
        [bool]       $isLicensed = $true,


        [Parameter(
            Mandatory         = $false,
            ValueFromPipeline = $false
        )]
        [switch]     $SkipAdminCheck


    )


    BEGIN {
        if (-not $SkipAdminCheck) {
            $AdminUsers = Get-MsolRole -ErrorAction Stop | foreach {Get-MsolRoleMember -RoleObjectId $_.ObjectID} | Where-Object {$null -ne $_.EmailAddress} | Select EmailAddress -Unique | Sort-Object EmailAddress
        }
    }

    PROCESS {
        if ($PSBoundParameters.ContainsKey(&quot;UserPrincipalName&quot;)) {
            foreach ($MsolUser in $UserPrincipalName) {
                try {
                    $User = Get-MsolUser -UserPrincipalName $MsolUser -ErrorAction Stop

                    if ($SkipAdminCheck) {
                        $isAdmin = &quot;-&quot;
                      } else {
                        if ($AdminUsers -match $User.UserPrincipalName) {
                            $isAdmin = $true
                          } else {
                            $isAdmin = $false
                        }
                    }

                    if ($User.StrongAuthenticationMethods) {
                        $MFAEnabled = $true
                      } else {
                        $MFAEnabled = $false
                    }


                    [PSCustomObject]@{
                        DisplayName       = $User.DisplayName
                        UserPrincipalName = $User.UserPrincipalName
                        isAdmin           = $isAdmin
                        MFAEnabled        = $MFAEnabled
                    }

                } catch {
                    [PSCustomObject]@{
                        DisplayName       = '_NotSynced'
                        UserPrincipalName = $User
                        isAdmin           = '-'
                        MFAEnabled        = '-'
                    }
                } finally {
                    $null = $User
                    $null = $isAdmin
                    $null = $MFAEnabled
                }
            }
        } else {
            $AllUsers = Get-MsolUser -MaxResults $MaxResults | Where-Object {$_.IsLicensed -eq $isLicensed}
            foreach ($User in $AllUsers) {
                if ($SkipAdminCheck) {
                    $isAdmin = &quot;-&quot;
                  } else {
                    if ($AdminUsers -match $User.UserPrincipalName) {
                        $isAdmin = $true
                      } else {
                        $isAdmin = $false
                    }
                }

                if ($User.StrongAuthenticationMethods) {
                    $MFAEnabled = $true
                  } else {
                    $MFAEnabled = $false
                }


                [PSCustomObject]@{
                    DisplayName       = $User.DisplayName
                    UserPrincipalName = $User.UserPrincipalName
                    isAdmin           = $isAdmin
                    MFAEnabled        = $MFAEnabled
                }

                $null = $User
                $null = $isAdmin
                $null = $MFAEnabled

            }
        }
    }

    END {}

}

</pre>
<p>&nbsp;</p>
<p><a href="https://thesysadminchannel.com/wp-content/uploads/2019/04/Get-AzureMFAStatus.png" target="_blank" rel="noopener noreferrer"><img fetchpriority="high" decoding="async" src="https://thesysadminchannel.com/wp-content/uploads/2019/04/Get-AzureMFAStatus.png" alt="Get-AzureMFAStatus" width="1229" height="524" class="aligncenter size-full wp-image-1423" srcset="https://thesysadminchannel.com/wp-content/uploads/2019/04/Get-AzureMFAStatus.png 1229w, https://thesysadminchannel.com/wp-content/uploads/2019/04/Get-AzureMFAStatus-1024x437.png 1024w, https://thesysadminchannel.com/wp-content/uploads/2019/04/Get-AzureMFAStatus-768x327.png 768w" sizes="(max-width: 1229px) 100vw, 1229px" /></a></p>
<p>So that&#8217;s it.  That&#8217;s how you get MFA status for Office365 / Azure for your domain.  Hopefully you found this useful and if you did, don&#8217;t forget to check out our Youtube channel at <a href="https://www.youtube.com/channel/UC9VnUjmZrNG3ithDZmG-S-g" rel="noopener noreferrer" target="_blank">@theSysadminChannel</a></p>
<p>The post <a href="https://thesysadminchannel.com/get-mfa-status-for-azure-office365-users-using-powershell/">Get MFA Status For Azure/Office365 Users Using Powershell</a> appeared first on <a href="https://thesysadminchannel.com">the Sysadmin Channel</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://thesysadminchannel.com/get-mfa-status-for-azure-office365-users-using-powershell/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1400</post-id>	</item>
	</channel>
</rss>
