Removing contacts is essential to maintaining directory accuracy and mitigating security risks. This ensures access is restricted to only the right individuals. You can achieve this using both Microsoft Graph PowerShell and ADManager Plus. However, scripting requires advanced technical skills. In contrast, ADManager Plus offers a zero-script, user-friendly interface for effortless contact management.
Enter the contact names to delete.
Import a CSV file to delete multiple contacts simultaneously.
Before using the cmdlet, ensure that the Microsoft Graph PowerShell module is installed. If not, install it using this script:
Install-Module Microsoft.Graph -Scope CurrentUser
Run the following cmdlet in Microsoft Graph PowerShell to remove a Microsoft Entra ID contact:
Remove-MgContact
-OrgContactId <String>
[-IfMatch <String>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PassThru]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The following are some essential parameters that can be used along with the Remove-MgContact command:
| Parameters | Description |
|---|---|
| -Confirm | Prompts you for confirmation before running the cmdlet. |
| -Headers | Optional headers that will be added to the request. |
| -OrgContactId | The unique identifier of the organization contact . |
| -PassThru | Returns true when the command succeeds. |
| -WhatIf | Shows what would happen if the cmdlet runs. |
ADManager Plus, an identity governance and administration solution with comprehensive Microsoft Entra ID management and reporting capabilities, simplifies complex admin tasks from a single, user-friendly console: