Quick & dirty way to bulk delete project sites

I had a requirement to bulk delete 2000 project sites. This used to be much easier in good old PSI days. Project Server CSOM couldn't do it and PSI support has been removed from Project Online & Project Server 2016.

To solve this problem, I wrote a script that basically simulates going to "Connected SharePoint Sites" page and click "Delete Site" button for each Project :) This is tested on Project Server 2016 only.

Here are the steps to apply this script.

1- In Chrome, go to PWA Settings -> Connected SharePoint Sites
2- Press F12 to get in developer mode
3- In Console window, copy paste the script provided at the end of this article and press Enter
4- Type DeleteSites() and press Enter
5- Watch the magic in Console :)

The JavaScript code is as following


Post a Comment