{"id":2360,"date":"2023-08-04T10:52:40","date_gmt":"2023-08-04T09:52:40","guid":{"rendered":"http:\/\/blog.campodoro.org\/?p=2360"},"modified":"2023-08-04T10:58:25","modified_gmt":"2023-08-04T09:58:25","slug":"microsoft-365-disable-mfa-on-admin-account-using-powershell-when-locked-out","status":"publish","type":"post","link":"https:\/\/blog.campodoro.org\/?p=2360","title":{"rendered":"Microsoft 365 &#8211; Disable MFA on admin account using PowerShell when locked out"},"content":{"rendered":"<p>The phone-number associated with the admin account was no longer available so the client couldn&#8217;t access the admin portal of Microsoft 365 as the following message popped-up:<\/p>\n<p><em>&#8220;More information required &#8211;\u00a0Your organisation needs more information to keep your account secure&#8221;<\/em><\/p>\n<p>And there was NO way to get passed that. Total lock-out. So, fire up PowerShell on a Windows machine (PS on a Mac does not work with MSOnline) and copy\/paste the following lines to disable MFA and get asked to enter a new phone number! Please change the admin email and password to yours.<\/p>\n<pre class=\"p1\">Set-ExecutionPolicy RemoteSigned\r\nInstall-Module PowershellGet -Force\r\nInstall-Module -Name ExchangeOnlineManagement\r\nImport-Module ExchangeOnlineManagement\r\n\r\n$secpasswd = ConvertTo-SecureString -String '<strong>SuperSecretPassword<\/strong>' -AsPlainText -Force\r\n$o365cred = New-Object System.Management.Automation.PSCredential (\"<strong>adminemail@address.com<\/strong>\", $secpasswd)\r\nConnect-ExchangeOnline -Credential $o365cred -ShowBanner:$false\r\n\r\nInstall-Module MSOnline\r\nImport-Module MSOnline\r\nConnect-MsolService -Credential $o365cred\r\n\r\nGet-MsolUser -UserPrincipalName <strong>adminemail@address.com<\/strong> | Set-MsolUser -StrongAuthenticationMethods @()<\/pre>\n<div class=\"tweetthis\" style=\"text-align:left;\"><p> <a class=\"tt\" href=\"http:\/\/twitter.com\/share?url=https:\/\/blog.campodoro.org\/?p=2360&text=Microsoft+365+%E2%80%93+Disable+MFA+on+admin+account+using+PowerShell+when+locked+out+%23campodoro+%23tips+...&via=goudkamp&related=richardxthripp%2Ctweetthisplugin\" title=\"Twitter\"><img decoding=\"async\" class=\"nothumb\" src=\"http:\/\/blog.campodoro.org\/wp-content\/plugins\/tweet-this\/icons\/en\/twitter\/tt-twitter.png\" alt=\"Post to Twitter\" \/><\/a> <a class=\"tt\" href=\"http:\/\/twitter.com\/share?url=https:\/\/blog.campodoro.org\/?p=2360&text=Microsoft+365+%E2%80%93+Disable+MFA+on+admin+account+using+PowerShell+when+locked+out+%23campodoro+%23tips+...&via=goudkamp&related=richardxthripp%2Ctweetthisplugin\" title=\"Twitter\">Tweet<\/a> <a class=\"tt\" href=\"http:\/\/delicious.com\/post?url=https:\/\/blog.campodoro.org\/?p=2360&amp;title=Microsoft+365+%E2%80%93+Disable+MFA+on+admin+account+using+PowerShell+when+locked+out\" title=\"Post to Delicious\"><img decoding=\"async\" class=\"nothumb\" src=\"http:\/\/blog.campodoro.org\/wp-content\/plugins\/tweet-this\/icons\/en\/delicious\/tt-delicious.png\" alt=\"Post to Delicious\" \/><\/a> <a class=\"tt\" href=\"http:\/\/delicious.com\/post?url=https:\/\/blog.campodoro.org\/?p=2360&amp;title=Microsoft+365+%E2%80%93+Disable+MFA+on+admin+account+using+PowerShell+when+locked+out\" title=\"Post to Delicious\">Post to Delicious<\/a> <a class=\"tt\" href=\"http:\/\/www.facebook.com\/share.php?u=https:\/\/blog.campodoro.org\/?p=2360&amp;t=Microsoft+365+%E2%80%93+Disable+MFA+on+admin+account+using+PowerShell+when+locked+out\" title=\"Post to Facebook\"><img decoding=\"async\" class=\"nothumb\" src=\"http:\/\/blog.campodoro.org\/wp-content\/plugins\/tweet-this\/icons\/en\/facebook\/tt-facebook.png\" alt=\"Post to Facebook\" \/><\/a> <a class=\"tt\" href=\"http:\/\/www.facebook.com\/share.php?u=https:\/\/blog.campodoro.org\/?p=2360&amp;t=Microsoft+365+%E2%80%93+Disable+MFA+on+admin+account+using+PowerShell+when+locked+out\" title=\"Post to Facebook\">Post to Facebook<\/a><\/p><\/div>","protected":false},"excerpt":{"rendered":"<p>The phone-number associated with the admin account was no longer available so the client couldn&#8217;t access the admin portal of Microsoft 365 as the following message popped-up: &#8220;More information required &#8211;\u00a0Your organisation needs more information to keep your account secure&#8221; &hellip; <a href=\"https:\/\/blog.campodoro.org\/?p=2360\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,247,44],"tags":[],"class_list":["post-2360","post","type-post","status-publish","format-standard","hentry","category-aaaarghh","category-microsoft-365","category-windows-2"],"_links":{"self":[{"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/posts\/2360"}],"collection":[{"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2360"}],"version-history":[{"count":3,"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/posts\/2360\/revisions"}],"predecessor-version":[{"id":2363,"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=\/wp\/v2\/posts\/2360\/revisions\/2363"}],"wp:attachment":[{"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.campodoro.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}