I'm using Microsoft Project Server 2010 and I need to bulk update some SharePoint lists in the the Project Web Sites (PWS) associated with active Projects.
Projects are deemed to be 'active' if the Project Status custom field has some specific values.
Something like the following pseudocode:
Get-AllProjectServerProjects |
Where-Object { ($_.CustomFields["Project Status"]) -eq 'active' } |
Foreach-Object {
$projectWebSite = $_.ProjectWebSiteURL
# Code here to update SharePoint list for this site
}
I already have code to update the SharePoint lists, what I'm looking for is a way to get the Project Web Sites associated with 'active' projects.
As far as I can tell, there are no PS cmdlets that expose Project Server data. Rather, it is necessary to go via the PSI web service and use the ReadProjectList() method.
I've managed to get a list of projects via ReadProjectList() but cannot tell if they are 'active' projects and I've not managed to find a direct link to a project web site.
I could iterate through all the project web sites by using the SharePoint cmdlets and match on the project name, but this does not seem optimal and I still need to know which projects are 'active'.