Updated Publish all Projects in #ProjectServer using #PowerShell #MSProject #PS2010 #SP2010 #PS2013

May 31, 2012 at 11:48 am | Posted in Administration, Functionality, PowerShell, PSI | 4 Comments
Tags: , , , ,

I have been meaning to update the publish all script for a while now but only just got a chance to post the updated script here and also published it to the script center.

The publish all script from my earlier blog post works fine until you have a project that exists in the Archive database and not the Draft database (working store). An error will appear in the Project Server queue similar to this:

ProjectPublish.VerifyWorkingProjectExistsMessage

As the original script uses the ReadProjectList method, it is not possible to specify the data store. The new script uses the ReadProjectStatus method as this allows you to specify the data store.

The updated line can bee seen below, to access the full script please visit the script center:

$ProjectList = $svcPSProxy.ReadProjectStatus(“$EPMTYGUID”,”WorkingStore”,””, “0”).Project | format-table proj_uid -hidetableheaders | out-string –stream

Full script available below:

http://gallery.technet.microsoft.com/scriptcenter/Server-2010-Publish-all-45ba385b

****Update – this also works for Project Server 2013****

The script will need to be updated for the correct PWA URL as shown below. The script has my test PWA instance URL as highlighted below:

New-WebServiceProxy -uri “http://vm353/pwatest/_vti_bin/PSI/Project.asmx?wsdl” –useDefaultCredential

The strikethrough text will need to be updated with the correct URL for your environment.

This script can be run on demand or scheduled. To schedule this to run on a nightly / weekly basis use the Windows Task Scheduler. Create a new batch file to execute the PowerShell script from the scheduled task. An example of the command need in the batch file can be seen below:

“%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe” -command “& ‘C:\PublishAllProjects.ps1′”

Set the scheduled task to run under the PWA administrator account to publish all projects.

Advertisements

4 Comments »

RSS feed for comments on this post. TrackBack URI

  1. […] Hoje encontrei este artigo com esta dica. […]


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: