none
What must I use instead of Project Server Interface (PSI) for project Server 2016-2019? RRS feed

  • Question

  • Hello!

    A question to Microsoft Support for Partners:

    We are a partner of Microsoft.

    We develop integration of our internal corporative on-premises Project Server 2016 and our internal-use YouTrack instance.

    We know of recommendations from Microsoft to use the PSI (Project Server Interface) 2013.

    https://docs.microsoft.com/en-us/office/client-developer/project/project-server-2013-architecture-and-programmability

    We failed to access the PSI on our instance of MS Project server 2016:

    PS C:\Users\latyshev.kon> $svcPSProxy = New-WebServiceProxy -uri "http://msk-project-t/pwa/_vti_bin/PSI/Project.asmx?wsdl" -useDefaultCredential

    New-WebServiceProxy : The request failed with HTTP status 404: Not Found.

    At line:1 char:15

    + ... vcPSProxy = New-WebServiceProxy -uri "http://msk-project-t/pwa/_vti_b ...

    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ObjectNotFound: (http://msk-proj...oject.asmx?wsdl:Uri) [New-WebServiceProxy], WebException

        + FullyQualifiedErrorId : WebException,Microsoft.PowerShell.Commands.NewWebServiceProxy

    PS C:\Users\latyshev.kon>

    To fulfill our Project Server - YouTrack integration we need to solve a local problem:

    How to publish a selected enterprise project on Enterprise PWA using a PowerShell script?

    What can You recommend us?


    Tuesday, 17 December 2019 2:33 PM

Answers

  • Hello,

    The Project class is removed from the PSI from 2016 onward - you will need to use CSOM: https://docs.microsoft.com/en-us/office/client-developer/project/getting-started-with-the-project-server-csom-and-net similar to below for publishing all projects:

    #Update correct location for the Project Server Client dll
    Import-Module 'C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.ProjectServer.Client.dll'
    #Update the PWA URL for the on-prem Project Server 2016 PWA URL
    $pwaPath = "PWA URL"
    
    $projContext = New-Object Microsoft.ProjectServer.Client.ProjectContext($pwaPath)
    
    $projects = $projContext.Projects    
    $projContext.Load($projects)
    $projContext.ExecuteQuery()
    
    $projects = $projContext.Projects | select Id,Name
    
    Foreach ($project in $projects){
    Try{
            $proj = $projContext.Projects.GetByGuid($project.Id)
            $draftProject = $proj.CheckOut()
            $draftProject.Publish($true) | Out-Null
            $projContext.ExecuteQuery()
            Write-host -ForegroundColor Green $project.Name " has been published"    
        }
    Catch{
            write-host -ForegroundColor Red "Add error occurred whilst attempting to publish project: "$project.Name". The error details are: $($_)"
        }
    }
    Update and fully test etc. on a non production PWA instance before Production.  

    Paul


    Paul Mather | Twitter | http://pwmather.wordpress.com | CPS | MVP | Downloads

    Wednesday, 18 December 2019 12:35 PM
    Moderator

All replies

  • Вы задали вопрос в русскоязычной части форума

    The opinion expressed by me is not an official position of Microsoft

    Tuesday, 17 December 2019 2:41 PM
  • Project server здесь.
    Tuesday, 17 December 2019 2:53 PM
  • Hello, Konstantin

    I will move your question to the right forum branch.


    Мнения, высказанные здесь, являются отражением моих личных взглядов, а не позиции корпорации Microsoft. Вся информация предоставляется "как есть" без каких-либо гарантий.

    Wednesday, 18 December 2019 7:40 AM
  • Ok. It will help me.
    Wednesday, 18 December 2019 9:40 AM
  • Hello,

    The Project class is removed from the PSI from 2016 onward - you will need to use CSOM: https://docs.microsoft.com/en-us/office/client-developer/project/getting-started-with-the-project-server-csom-and-net similar to below for publishing all projects:

    #Update correct location for the Project Server Client dll
    Import-Module 'C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.ProjectServer.Client.dll'
    #Update the PWA URL for the on-prem Project Server 2016 PWA URL
    $pwaPath = "PWA URL"
    
    $projContext = New-Object Microsoft.ProjectServer.Client.ProjectContext($pwaPath)
    
    $projects = $projContext.Projects    
    $projContext.Load($projects)
    $projContext.ExecuteQuery()
    
    $projects = $projContext.Projects | select Id,Name
    
    Foreach ($project in $projects){
    Try{
            $proj = $projContext.Projects.GetByGuid($project.Id)
            $draftProject = $proj.CheckOut()
            $draftProject.Publish($true) | Out-Null
            $projContext.ExecuteQuery()
            Write-host -ForegroundColor Green $project.Name " has been published"    
        }
    Catch{
            write-host -ForegroundColor Red "Add error occurred whilst attempting to publish project: "$project.Name". The error details are: $($_)"
        }
    }
    Update and fully test etc. on a non production PWA instance before Production.  

    Paul


    Paul Mather | Twitter | http://pwmather.wordpress.com | CPS | MVP | Downloads

    Wednesday, 18 December 2019 12:35 PM
    Moderator