Microsoft Project Server 2010 and PowerShell

December 23, 2009 @ Christophe Fiessinger's Blog from chrisfie

In case you have not heard SharePoint 2010 and Project Server 2010 will support PowerShell and hence will ship with a library of already about 650 commands. Please find below a few examples I wrote trying to automate Project Service Application creation.

One useful commands to get started:  Get-Help *project* (lists all cmdlet that contains the word ‘project’).

image

Check out this recently Project Server 2010 PowerShell Help file for more information: http://technet.microsoft.com/en-us/library/ee890098(office.14).aspx

As usual we will release Project Server 2010 PowerShell documentations by RTM on TechNet. One of the great thing about PowerShell is that you can easily create your own commands (think of a utility that issues PSI calls for instance…), stay tune for more samples MSDN, in the meantime experiment the power of PowerShell :)

$projectapppool = "ProjectServer-AppPool"
$projectserviceapp = "ContosoProjectServiceApplication"
$pwaname = "PWA"
$projectwebappname = "Contoso Project Server Site"
$projectwebappport = 82
$projectwebappurl = "http://www.contoso.com"
$projectwebcontentdb = "ProjectServer"+$projectwebappport+"_Content"
$adminaccount = "contoso\administrator"
$databaseserver = "DEMO2010A"

# Create Application Pool
New-SPIisWebServiceApplicationPool -Name $projectapppool -Account $adminaccount

# Create Project Service Application
New-SPProjectServiceApplication -ApplicationPool $projectapppool -Name $projectserviceapp

# Create Project Service Application Proxy
New-SPProjectServiceApplicationProxy -Name ContosoProjectServiceApplicationProxy -ServiceApplication $projectserviceapp

# Create Project Server Web Application with its own Content Database
New-SPWebApplication -Name $projectwebappname -Port $projectwebappport -URL $projectwebappurl -ApplicationPool $projectapppool -ApplicationPoolAccount $adminaccount -DatabaseName $projectwebcontentdb

# Create New Project Server Site Collection
# Get-SPWebTemplate
New-SPSite -Url ($projectwebappurl+ ":" +$projectwebappport) -OwnerAlias $adminaccount -ContentDatabase $projectwebcontentdb -Template PWS#0

# Provision PWA Instance
New-SPProjectWebInstance -AdminAccount $adminaccount -ArchiveDbname ($pwaname +"_Archive") -DraftDbname ($pwaname +"_Draft") -PrimaryDbserver $databaseserver -PublishedDbname ($pwaname +"_Published") -ReportingDbname ($pwaname +"_Reporting") -ReportingDbserver $databaseserver -Url ($projectwebappurl + ":" + $projectwebappport + "/" + $pwaname) -Lcid 1033

Great PowerShell resources:

   
 

Related Posts


This article is syndicated from LeadingAnswers: Leadership and Agile Project Management Blog . The original article is available here. Read more in LeadingAnswers, Project Management News .


Reminder : PMToolbox has ZERO tolerance to copyright violation and agrees to follow strictly PMI's Professional Responsibility. That's why each post on this site includes a link to the original version at its source site.

Comments

Got something to say?






Get Adobe Flash playerPlugin by wpburn.com wordpress themes

pmtoolbox.com is your one stop source for project management software, books, templates, articles and news, glossary, tools...