Home > Paul Mather, Work > #ProjectServer #PS2010 / #PS2013 delete #Project site using #PowerShell #SP2013 #SP2010

#ProjectServer #PS2010 / #PS2013 delete #Project site using #PowerShell #SP2013 #SP2010

Paul Mather
I am a Project Server and SharePoint consultant but my main focus currently is around Project Server.
I have been working with Project Server for nearly five years since 2007 for a Microsoft Gold Certified Partner in the UK, I have also been awared with the Microsoft Community Contributor Award 2011.
I am also a certified Prince2 Practitioner.

This article has been cross posted from pwmather.wordpress.com (original article)

Following on from a post / script I created a year or so ago to bulk create project sites, there have been requests to be able to bulk delete projects sites. I have been reluctant to do that as i am always cautious when “bulk” deleting! The script i have created reads the list of projects from a text file so that the user running the script knows exactly what project sites they are going to be delete. The script can be downloaded from the Microsoft Script gallery below:

http://bit.ly/1QSXuZb

The text file will need to be created with a list of projects names from your PWA instance – ONLY INCLUDE project names for the project sites you want to delete – all site data (lists, documents etc.) will be deleted as the site will be deleted! The only scenario I would really use a script like this is if I wanted to delete all of my project sites, if I only needed to remove a handful I would do it manually via the UI. The example text file can be seen below:

image

Update the location of the text file and text file name for the Get-Content command.

The web service proxy URLs will need to be updated for your PWA instance, replace the http://vm753/pwa with the correct URL.

image

The script can be seen running and deleting sites below:

From the PowerShell ISE:

image

All data from the project sites will be lost so please use this with care and only enter project names in the text file for projects sites and project site data you no longer need.

Run the script with a PWA administrator account.

Fully test this script on a test / non-production PWA instance before running on any production environment. As a precaution, take full database backups (PWA and SharePoint Content) before running the script on the production environment so that you can roll back if needed.

The script is provided "As is" with no warranties etc.

Advertisements
Categories: Paul Mather, Work Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: