Quantcast
Channel: PS2010 – Paul's Project Server and Project Online Blog
Viewing all articles
Browse latest Browse all 59

Create a #ProjectServer #PS2010 #PS2013 project from a template and update the EPT #SP2013 #SP2010 #PowerShell

$
0
0

I have been meaning to publish this PowerShell script for a few months but finally got around to it today. The PowerShell script creates a project from a template then updates the Enterprise Project Type (EPT). I did write a post over a year ago on how to create a project using PowerShell but this didn’t update the EPT:

http://pwmather.wordpress.com/2012/01/17/create-and-publish-a-project-in-projectserver-via-powershell-ps2010-msproject-sp2010/

The issue is that even if your Project Plan Template is associated to an EPT in Project Server, the project created from the CreateProjectFromTemplate method is associated to the default EPT regardless. This script will prompt for the project name, the project plan template name and the EPT name. It will create the project then update the project to associate it to the desired EPT. The script can be downloaded from the script gallery below:

http://gallery.technet.microsoft.com/scriptcenter/Create-Server-2010-2013-19bd3cc7

Once downloaded, the script will need to be updated with the correct PWA URL, the lines that need updating are 9 and 23. These can bee seen below:

image

image

Update the http://vm753/pwa part of the URL for your PWA URL.

A walkthrough using the script is below.

Open Windows PowerShell and navigate to the PowerShell file, in this example it is on the desktop:

image

Press Enter and complete the details:

image

The new Project will be called “CPS Test Project by Paul Mather”, it will use the “PMTemp1” template and then associate the new project to the “PM TEST” EPT.

image

The project is created as you can see in the Project Center:

image

It is also associated to the specified EPT:

image

The default EPT on this PWA instance is “Enterprise Project”:

image

When using the CreateProjectFromTemplate method only, this new project would have been associated to the Enterprise Project EPT as this is the default EPT.

This is just an example of what can be done, many improvements could be made, certainly around error handling but it provides a working example for you to build on. Smile



Viewing all articles
Browse latest Browse all 59

Trending Articles