Close Menu
Altcoinvest
    What's Hot

    Earn Daily Crypto Easily – Bow Miner’s AI Cloud Mining allows you to profit while you sleep!

    May 9, 2025

    How to Start Day Trading as a Beginner

    May 8, 2025

    Bitcoin Traders Eye $93K-$99K as Bearish Sentiment Grows in Volatile Market

    May 8, 2025
    Facebook X (Twitter) Instagram
    Altcoinvest
    • Bitcoin
    • Altcoins
    • Exchanges
    • Youtube
    • Crypto Wallets
    • Learn Crypto
    • bitcoinBitcoin(BTC)$103,078.003.69%
    • ethereumEthereum(ETH)$2,303.3115.72%
    • tetherTether(USDT)$1.00-0.02%
    • rippleXRP(XRP)$2.355.47%
    • binancecoinBNB(BNB)$633.952.58%
    • solanaSolana(SOL)$169.127.53%
    • usd-coinUSDC(USDC)$1.000.00%
    • dogecoinDogecoin(DOGE)$0.2031399.23%
    • cardanoCardano(ADA)$0.787.69%
    • tronTRON(TRX)$0.2616654.62%
    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 [email protected] 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

    April 2025 Exchange Server Hotfix Updates

    May 7, 2025

    VBScript: create an HTML Outlook email signature for the whole company

    May 7, 2025

    Fix Exchange Server Jet Error Code 1601 & 1605 [Resolved]

    May 7, 2025

    VBScript – end of life is coming

    May 4, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Tweets by InfoAltcoinvest

    Top Posts

    April 2025 Exchange Server Hotfix Updates

    May 7, 2025

    VBScript: create an HTML Outlook email signature for the whole company

    May 7, 2025

    Fix Exchange Server Jet Error Code 1601 & 1605 [Resolved]

    May 7, 2025

    Massive Bitcoin BUY Signal! Are You Afraid?

    February 19, 2025

    Something Weird is Happening With The Boeing Starliner

    March 27, 2025

    Is a Solana ETF Approval Closer: Experts Weigh In

    February 25, 2025

    BITCOIN & CRYPTO LIVE UPDATE WITH @CryptoDada Pendulum Swings #bitcointradingbangla #banglatrading

    May 7, 2025

    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

    Earn Daily Crypto Easily – Bow Miner’s AI Cloud Mining allows you to profit while you sleep!

    May 9, 2025

    How to Start Day Trading as a Beginner

    May 8, 2025

    Bitcoin Traders Eye $93K-$99K as Bearish Sentiment Grows in Volatile Market

    May 8, 2025
    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
    © 2025 altcoinvest.com

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