Updated Publish all Projects in #ProjectServer using #PowerShell #MSProject #PS2010 #SP2010 #PS2013May 31, 2012 at 11:48 am | Posted in Administration, Functionality, PowerShell, PSI | 4 Comments
Tags: Project 2010, Project Server 2010, Project Server 2013, PS2010, 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:
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 “
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.