How to delete all hotmail.com/outlook.com account contacts at once

 Hi everybody!

As you know, Web UI of outllok.com does not allow to delete more than 50 contacts at ones (in some cases this limit is even 10 contacts)After unsuccessful attempts to delete 1000+ contacts from my Hotmail account I created Python script that removes all contacts from your hotmail.com/outlook.com account

This program should work with any MS Exchange/Office365 account but I can't test it.


Be very careful to run this program in your corporate environment (not tested), I tested it only with my consumer hotmail.com account.

I used Basic authentication (still supported by Hotmail) but you can change it to OAUTH2 if your server requires it.

You can see and download this program from  https://github.com/Symnok/DeleteHotmailOutlookContacts/tree/main

Feel free to modify this program to your needs (at least you need to use your own credentials)

This python3 program removes all contacts at ones.

1. Install python3

2. Install exchangelib:

pip install exchangelib

3. This program uses Basic Authentication (not OAUTH2) that still (as of Sept 1 2023) supported by Microsoft for outlook.com/hotmail.com The code uses MS Exchange server m.hotmail.com but you can modify the code to use any of the following URLs as of September 1 2023:

m.outlook.com

outlook.office365.com

eas.outlook.com

s.outlook.com

4. In the code, set your hotmail.com/outlook.com credentials in

ACCOUNT_USERNAME_AND_EMAIL

and

ACCOUNT_PASSWORD

5. 2FA supported! If you use 2FA, generate application password and set its value to ACCOUNT_PASSWORD

6. You must use modern OS that supports TLS 1.2. TLS 1.1 and below is not supported anymore by the corresponding Exchange servers

7. Use this program on your own risk. It may contain bugs that can cause data loss, email loss, contacts loss, Microsoft/hotmail.com/outlook.com and any other

account suspension, account deletion, permanent ban by Microsoft and other unexpected consequences. USE THIS PROGRAM ON YOUR OWN RISK!!!

8. This program may not work if your account registered using non-Microsoft email address with hotmail.com/outlook.com account. Add Microsoft email address @outlook.com to your account, make it Default Alias and use this email with this program.

9. Run this program as

python3 deleteHotmailOutlookContacts.py

10. On Contact UI page turn ON New Contacts option (if available). The program will work without this option too but you will not see if some contacts are stuck and not deleted

11. You may need to run this program few times before al contacts are deleted. Wait 3-5 mins before second and additional runs. You may need to remove a few remaining contacts manually.

12. Use following resources to learn how modify this program (for example, to add OAUTH2 support):

https://ecederstrand.github.io/exchangelib/#folders

https://ecederstrand.github.io/exchangelib/exchangelib/#exchangelib.Account.contacts

___________________________ https://answers.microsoft.com/en-us/outlook_com/forum/outlk_com-outtop_people/how-to-delete-all-hotmailcomoutlookcom-account/b76bb2c1-eb17-43e2-b99c-0d22d0de0a13

https://www.reddit.com/r/Outlook/comments/16a42nk/how_to_delete_all_hotmailcomoutlookcom_account/



Comments

Popular posts from this blog

IMAP, POP and SMTP settings of email providers for legacy email clients without OAUTH2 support

Инструкция по раскирпичиванию устройств Lumia без программатора.

How to safeguard Microsoft/hotmail.com/outlook.com account