none
How do I access Project Online Tasks using powershell. RRS feed

  • Question

  • Hi,

    I am trying to access project online tasks using powershell.  I found this C# code but can't find a sample using powershell.  Can anyone help with converting this to do the same thing via powershell?

    I would appreciate the help.

    Thanks

    Don

     ProjectCont.Load(ProjectCont.Projects, c => c.IncludeWithDefaultProperties
    ( pr => pr.Assignments, pr => pr.FinishDate, pr => pr.Tasks,  pr => pr.PercentComplete, pr => pr.ProjectResources));
     ProjectCont.ExecuteQuery();


    Don Landry


    • Edited by Don Landry Wednesday, August 23, 2017 9:52 AM
    Wednesday, August 23, 2017 9:52 AM

All replies

  • Hello,

    What is the purpose? Maybe you could use the OData API? An example accessing the OData API, not tasks, but you will get the idea:

    https://pwmather.wordpress.com/2016/05/17/extract-projectonline-or-projectserver-2013-2016-timesheet-data-powershell-office365/

    Paul


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

    Wednesday, August 23, 2017 11:00 AM
    Moderator
  • Hey Paul,

    The purpose is that I am writing an interface between Clarity and Project Online to take input data from Clarity and load it to Project online via CSOM.  I have to determine for each project whether it exists within Project Online and for each task passed whether the task exists and whether the resource exists in order to do tasks adds/updates, resource adds/update and assignment add/updates correctly. 

    In the example above the projContext.Load in C# seems to allow you to query the records from Project to tasks to resources to assignments. 

    I had looked at your example using the filter but yours only goes after one record verses selecting a project and all its tasks, then from tasks to assignments then to resources etc.  If you have any examples like that I'd love to see them.  Once I'm done with this project I will be doing a blog on the design and how I coded the solution.

    I'm certainly, at the moment, not even intermediate CSOM/Powershell developer I'm more of a techie PM so learning this has been a lot of fun with its share of head scratching and trial and error.  Any thoughts/assistance would be much appreciated.

    Thanks

    Don


    Don Landry

    Wednesday, August 23, 2017 11:53 AM
  • Hello,

    The example was purely to show you an example to access the Odata API from PowerShell.  I dont have any examples that I would be able to share for the specific scenario you are looking at. It might be better to do that in a C# console app rather than PowerShell - you will probably find more code samples etc.

    Paul


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

    Thursday, August 24, 2017 12:25 PM
    Moderator