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

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:


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:


****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.

Comments are closed.

Blog at WordPress.com.

Up ↑

%d bloggers like this: