Forum Discussion
Denis_Christov
Jun 16, 2021Copper Contributor
Deleting contacts from a 365 shared mailbox
Hello all, I have been struggling for several hours to figure out how to delete all contacts from a shared mailbox in Microsoft 365 using Powershell. To no avail. I can import contacts from a CSV su...
Kais_mbarki
Brass Contributor
Bonjour
avez vous utilisé ce script comme import des contacts csv vers le mailbox ?
Import-ContactList -CSV -CSVData ([System.IO.File]::ReadAllBytes("C:\xxxxx.csv")) -DateCultureName "en-GB" -Identity xxxx@domaine.onmicrosoft.com ?
si oui , c'était quoi la commande lancer pour la supression contact ?
Denis_Christov
Jun 16, 2021Copper Contributor
Hi Kais,
I use similar script:
Import-ContactList -Identity someone@comapany.com -CSV -CSVData ([System.IO.File]::ReadAllBytes("c:\temp\sample.csv"))
That one works correctly.
For deletion I tried
Remove-MailContact -Identity someone@company.com
But it says that "object couldn't be found" for that identity
I'm running it all under global admin account.
- Kais_mbarkiJun 16, 2021Brass Contributordans la commande import : vous avez utilisé -Identity UserpricipaleName ?
- Kais_mbarkiJun 16, 2021Brass ContributorRemove-MailContact -Identity xxxxx est destiné pour les contact global du teant pour tous les utilisteurs et non pas pour une seul mailbox ...
a suivre j'ai le même soucis pour une boite à lettre d'un utilisteur- Denis_ChristovJun 16, 2021Copper ContributorAha. So it is not for a particular mailbox.
Hmmm. When it is possible to import contacts via Powershell, it SHOULD be possible to delte them with Powershell as well, right ? Maybe Microsoft considerd it unnecessary....