Close Menu
Altcoinvest
    What's Hot

    Bitcoin Record HODL Supply Hits Record Drought: What Next?

    May 29, 2026

    Crypto Waking Up – Top Altcoins To Focus On!!

    May 29, 2026

    XRP and ADA Get Boost From CME

    May 29, 2026
    Facebook X (Twitter) Instagram
    Altcoinvest
    • Bitcoin
    • Altcoins
    • Exchanges
    • Youtube
    • Crypto Wallets
    • Learn Crypto
    • bitcoinBitcoin(BTC)$73,881.000.40%
    • ethereumEthereum(ETH)$2,025.170.18%
    • tetherTether(USDT)$1.000.01%
    • binancecoinBNB(BNB)$641.610.09%
    • rippleXRP(XRP)$1.32-0.38%
    • usd-coinUSDC(USDC)$1.000.01%
    • solanaSolana(SOL)$82.670.03%
    • tronTRON(TRX)$0.344101-2.51%
    • Figure HelocFigure Heloc(FIGR_HELOC)$1.03-0.81%
    • dogecoinDogecoin(DOGE)$0.1002180.17%
    Altcoinvest
    Home»Exchange»How to Force Remove Contact in Microsoft 365 with PowerShell
    How to Force Remove Contact in Microsoft 365 with PowerShell
    Exchange

    How to Force Remove Contact in Microsoft 365 with PowerShell

    May 6, 2025
    Share
    Facebook Twitter LinkedIn Pinterest Email

    We unsynced all the contacts from Active Directory on-premises. However, one contact is still available in Microsoft 365. When we want to remove it from the Microsoft 365 portal, it will not let us, and it fails with an error. In this article, you will learn how to force remove a contact in Microsoft 365 with PowerShell.

    Let’s look at what happens when we want to delete the contact in the Microsoft 365 admin center and what error appears.

    1. Sign in to the Microsoft 365 admin center
    2. Expand Users > Contacts
    3. Select the contact from the list
    4. Delete the contact
    Force remove contact in Microsoft 365 with Powershell admin centerForce remove contact in Microsoft 365 with Powershell admin center
    1. Click Delete
    Force remove contact in Microsoft 365 with Powershell deleteForce remove contact in Microsoft 365 with Powershell delete

    The delete contact failed error appears.

    The operation on Identity failed because it’s out of the current user’s write scope. The action ‘Remove-MailContact’, can’t be performed on the object because the object is being synchronized from your on-premises organization. This action should be performed on the object in your on-premises organization.

    Force remove contact in Microsoft 365 with Powershell failed errorForce remove contact in Microsoft 365 with Powershell failed error

    So what if you don’t have an on-premises organization anymore, and the contact is a leftover? Let’s look at the next step to force the removal of the contact.

    To force remove the contact in Microsoft 365 (Exchange Online) using PowerShell, follow these steps:

    Step 1. Install Microsoft Graph PowerShell

    Run Windows PowerShell as administrator and Install Microsoft Graph PowerShell.

    Install both the Microsoft Graph PowerShell and the beta version. That’s because you need to use the beta cmdlet to remove the contact.

    Install-Module Microsoft.Graph -Force
    Install-Module Microsoft.Graph.Beta -AllowClobber -Force

    Important: Always update to the latest Microsoft Graph PowerShell module version before you run a cmdlet or script to prevent errors and incorrect results.

    Step 2. Connect to Microsoft Graph PowerShell

    Connect to Microsoft Graph PowerShell.

    Connect-MgGraph -Scopes OrgContact.Read.All, Directory.ReadWrite.All, Directory.Read.All

    Enter your global administrator credentials and accept the Microsoft Graph permissions request.

    Step 3. Get all contacts in Microsoft 365 with PowerShell

    Run the Get-MgContact PowerShell cmdlet to get the contact. This will list all the contacts.

    Get-MgContact -All | Sort-Object DisplayName

    The output appears.

    DisplayName Id                                   Mail               MailNickname
    ----------- --                                   ----               ------------
    Contact1    f1e8a63b-6961-4548-b7ea-caca8c7e5d47 contact1@gmail.com contact1

    Now that you have the contact ID, you can double-check and run the command below to retrieve the contact.

    Get-MgContact -OrgContactId "f1e8a63b-6961-4548-b7ea-caca8c7e5d47"

    Let’s go to the next step and remove the contact in Microsoft 365.

    Step 4. Force remove contact in Microsoft 365 with PowerShell

    Run the command below to remove the contact permanently from Microsoft 365.

    Note: You must use the Remove-MgBetaContact cmdlet because this has not yet been ported to the stable release.

    Remove-MgBetaContact -OrgContactId "f1e8a63b-6961-4548-b7ea-caca8c7e5d47"

    Step 5. Verify your work

    Check that the contact is removed.

    Get-MgContact -OrgContactId "f1e8a63b-6961-4548-b7ea-caca8c7e5d47"

    The contact is removed successfully and no longer appears in the Microsoft 365 admin center.

    Force remove contact in Microsoft 365 with Powershell verifyForce remove contact in Microsoft 365 with Powershell verify

    That’s it!

    Read more: Hard delete mailbox without deleting user account in Microsoft 365 »

    Conclusion

    You learned how to force remove a contact in Microsoft 365 with PowerShell. The only method to force remove the contact is to use the Microsoft Graph PowerShell cmdlet. It’s not possible with the Exchange Online PowerShell cmdlets. Remember that you need to install the Microsoft Graph Beta module to be able to use the cmdlet and remove the contact.

    Did you enjoy this article? You may also like Block sign-in from shared mailboxes. Don’t forget to follow us and share this article.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    How to Configure NTP Time Source on Domain Controller

    May 27, 2026

    How to Block Access for High-Risk AI Agents

    May 19, 2026

    Exchange Unattended Install Script [Update]

    May 7, 2026

    Conditional Access Policy Maximum Limit Explained

    May 7, 2026
    Add A Comment

    Comments are closed.

    Tweets by InfoAltcoinvest

    Top Posts

    How to Configure NTP Time Source on Domain Controller

    May 27, 2026

    How to Block Access for High-Risk AI Agents

    May 19, 2026

    Exchange Unattended Install Script [Update]

    May 7, 2026

    Rep. Marjorie Taylor Greene increases Bitcoin exposure during market dip

    December 5, 2025

    Bitcoin Advocate Urges Federal Reserve to Add BTC to Stress Tests

    January 21, 2026

    JPMorgan CEO Jamie Dimon Pushes Bank Rules for Stablecoin Issuers

    March 4, 2026

    NEX is available for trading!

    May 20, 2026

    Altcoinvest is a leading platform dedicated to providing the latest news and insights on the dynamic world of cryptocurrencies.

    We're social. Connect with us:

    Facebook X (Twitter)
    Top Insights

    Bitcoin Record HODL Supply Hits Record Drought: What Next?

    May 29, 2026

    Crypto Waking Up – Top Altcoins To Focus On!!

    May 29, 2026

    XRP and ADA Get Boost From CME

    May 29, 2026
    Get Informed

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.


    Facebook X (Twitter)
    • Home
    • About us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions
    © 2026 altcoinvest.com

    Type above and press Enter to search. Press Esc to cancel.