Extract #ProjectOnline or #ProjectServer 2013 / 2016 Timesheet data #PowerShell #Office365May 17, 2016 at 4:32 pm | Posted in Add-on, Administration, Configuration, Customisation, Functionality, Information, PowerShell, Reporting | Leave a comment
Tags: Office365, PowerShell, PPM, Project Online, Project Server 2013, Project Server 2016
This PowerShell script will use the Project Reporting OData API to extract the timesheet data between the given start and end dates. The user running the script specifies the source PWA instance URL, Username and password. They then enter the start and finish dates in yyyy-mm-dd format and run. The data will then be displayed in the console and output to a CSV file.
This script example can be downloaded here: https://gallery.technet.microsoft.com/Extract-Online-or-Server-c1cba361
To get the script to work you will need to reference the DLL as seen in the image below:
This can be installed from the SharePoint Online Client components / management shell. I used the dll from the SharePoint Online Management Shell in this example.
Please note, this has only been tested in PowerShell 3.0 and might not work in other versions. If you have any issues try this in PowerShell 3.0.
Firstly it will prompt for the source PWA URL:
Then the username and password:
Then the start and finish dates in yyyy-mm-dd format:
The script will output the data to the console:
It will also create a CSV file in the same folder that the PowerShell script is run from:
The CSV file:
This was only run against a test PWA instance in Project Online and only my account had timesheet data for the given period, it will return all of the timesheet data for all resources for the given start and finish dates.
This example requires the user to enter the environment details when running but it could easily be updated to hard code these then the PowerShell script could be scheduled to run weekly or monthly etc. The start and finish dates could be made dynamic too.
Whilst this only reads data, as always, this script is provided as is with no warranties etc. use at your own risk and test on a test environment before using on a production environment.