<p>One of the latest issues I had with M365 was the Outlook app on my mobile phone. After I had opened Outlook to check for my e-mails I was a bit surprised when I saw the following message in my Inbox:</p>
<p><strong>Account (my UPN) has been blocked on this device by your administrator.</strong></p>
<p><img class="alignnone size-full wp-image-4624" src="https://www.wincert.net/wp-content/uploads/2022/05/IMG_0850.png" alt="" width="369" height="800" /></p>
<p>The funny thing is the fact that I am one of the administrators of our tenant. As I wasn&#8217;t able to find anything strange in the EAC (Exchange Admin Center) I&#8217;ve opened Powershell and connected to my tenant to see what&#8217;s going on.</p>
<p>I have run Powershell in Admin mode and connected to my exchange online with the following command:</p>
<p><strong>connect-exchangeonline</strong></p>
<p>Since I had the<strong> iOS version 15.4.1</strong> I have used the following command to list my device and get InTune <strong>device ID:</strong></p>
<p><strong>Get-MobileDevice &#8211; Mailbox <;UPN>; | where {$_.deviceos -eq &#8220;iOS 15.4.1}</strong></p>
<ul>
<li>Replace <;UPN>; with your M365 UPN or e-mail address.</li>
</ul>
<p><img class="alignnone size-full wp-image-4625" src="https://www.wincert.net/wp-content/uploads/2022/05/Screenshot-2022-05-19-192930.jpg" alt="" width="851" height="339" /></p>
<p>After that, I could see that my device with Device ID was in <strong>Blocked DeviceAccessState</strong> by the Global policy.</p>
<p>Now, I had to unblock my device with the following Powershell command:</p>
<p><img class="alignnone size-full wp-image-4626" src="https://www.wincert.net/wp-content/uploads/2022/05/Screenshot-2022-05-19-193219.jpg" alt="" width="1028" height="474" /></p>
<p><strong>Set-CASMailbox -Identinty <;UPN>; -ActiveSycnAllowedDevice IDs &#8220;<;enter device ID that you have received from the previous command>;&#8221;</strong></p>
<ul>
<li>Replace the <;UPN>; with your M365 UPN or e-mail address.</li>
</ul>
<p>Now to check if everything is OK we can use the following commands:</p>
<p><strong>Get-CSMailbox -Identinty <;UPN>; | fl *active*</strong></p>
<p>This command will show us <strong>ActiveSyncAllowedDevice</strong> IDs.</p>
<p>Then, we can use the following command to see if the <strong>DeviceAccessStage</strong> was actually changed to <strong>Allowed</strong>.</p>
<p>If the device is now in the <strong>Allowed</strong> state you might need to wait for 15-30 minutes in order for changes to take effect. If no change happens in 30 minutes, try to restart your Outlook mobile app.</p>
<p>I hope this helps with the <strong>Account (my UPN) has been blocked on this device by your administrator</strong> error message.</p>

Account (my UPN) has been blocked on this device by your administrator
