Share via


PowerShell Steps to Configure Project Server 2013

PowerShell is such a cool tool. What I really like about it is that it documents exactly how things are setup in a server. The PowerShell script becomes the exact notes for configuration. This is important if you need to rebuild your server. I have seen other PowerShell scripts for setting up Project Server in SharePoint. Mine is a little different in that I include several steps that may have been left out and I create a managed path called PWA. The managed path PW makes it feels like the standard setup used in Project Server 2010.

These steps can be configured about SharePoint 2013 and Project Server 2013 have been installed and the SharePoint Configuration Wizard has been run.  Once that is done, these PowerShell commands can be run on the servers that are running project.

##########################################################################
# Author: Michael Wharton (MyProjectExpert.com)
# Date: 02/14/2013
# Description: Configure Project Server 2013 and creating PWA as subsite
#
# Once project server is installed the following steps can be done.  In the real world
# some of these steps may have already been done, in which case you would skip the command
# or generate an error indicating.
##########################################################################
Set-ExecutionPolicy "Unrestricted"
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
##########################################################################
#  Define key variables that need to be defined.
##########################################################################
$SqlServerName      = "LAB-2012SQL"
$SharePointName     = "LAB-2013SP"
$WebAppName         = "SharePoint - 80"
$WebAppURL          = "http://LAB-2013SP"
$PWA                = "http://LAB-2013SP/PWA"
$ProjectService     = "Project Service App"
$ProjectWebAppPool  = "Project Web App Pool"
$AcctFarmAdmin      = "LAB\FarmAdmin"
$AcctServiceSP      = "LAB\ServiceSP"
$ProjectWebAppDB    = "LAB_ProjectWebApp"
$PWAContentDB       = "LAB_PWA_WSS_CONTENT"
##########################################################################
 
#  Start Project Server Application Service
$PSServiceInstanceGUID = Get-SPServiceInstance | Where {$_.TypeName -eq "Project Server Application Service"}  
Start-SPServiceInstance $PSServiceInstanceGUID  
 
#  Setup managed account.  This may have already been done
$CredServiceSP = Get-Credential -UserName $AcctServiceSP -Message "Enter Password"
New-SPManagedAccount -Credential $CredServiceSP
 
#  Create application Pool. You could use an existing one
New-SPServiceApplicationPool  -Name $ProjectWebAppPool -Account $AcctServiceSP
 
#  Create the project server application
New-SPProjectServiceApplication –Name $ProjectService –ApplicationPool $ProjectWebAppPool –Proxy 
 
#  Create web application 
New-SPWebApplication -Name $WebAppName -port 80 -URL $WebAppURL -DatabaseName $PWAContentDB -DatabaseServer $SqlServerName -
 AuthenticationMethod NTLM -ApplicationPool $ProjectWebAppPool -ApplicationPoolAccount (Get-SPManagedAccount $AcctServiceSP)
 
#  Create root site and site collection.  I like to use the root as the PMO main page
New-SPSite $WebAppUrl -OwnerAlias $AcctFarmAdmin  -Name "Project Management Office" -Template "STS#0"
 
#  Test home site for PMO and check if it is working
START $WebAppUrl
 
#  Create project database. Notice that tag parameter.  It's required to connect to the PWA site  
New-SPProjectDatabase -Name $ProjectWebAppDB -ServiceApplication $ProjectService -DatabaseServer $SqlServerName -Tag 
"ProjectWebAppDB" 
 
#  Create managed path.  I always have liked the /PWA convention
New-SPManagedPath -WebApplication $WebAppURL -RelativeURL "/PWA" -Explicit
 
#  Create the project home site.  Its a bit tricky, but the key is to link site with project database using the tag
New-SPSite $PWA -OwnerAlias $AcctFarmAdmin -ContentDatabase $PWAContentdb -Template PWA#0
$web=Get-SPWeb $PWA
$web.Properties["PWA_TAG"]="ProjectWebAppDB"
$web.Properties.Update()
Enable-SPFeature pwasite -URL $PWA
 
#  Not required, but I typically set the permission mode to project
Set-SPPRojectPermissionMode –Url $PWA -AdministratorAccount $AdminAcct -Mode ProjectServer
 
#  Start the new PWA site
START $PWA