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

June 26, 2015 at 9:13 am | Posted in Add-on, Administration, Configuration, Customisation, Functionality, Information, PowerShell | Leave a comment
Tags: , , , , , , ,

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:

https://gallery.technet.microsoft.com/projectserver/Delete-Server-Sites-9c3d3e95

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

Leave a Comment »

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

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

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: