Extract #ProjectOnline or #ProjectServer 2013 / 2016 Timesheet data #PowerShell #Office365
I am a Project Server and SharePoint consultant but my main focus currently is around Project Server.
I have been working with Project Server for nearly five years since 2007 for a Microsoft Gold Certified Partner in the UK, I have also been awared with the Microsoft Community Contributor Award 2011. I am also a certified Prince2 Practitioner. This article has been cross posted from pwmather.wordpress.com (original article) |
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: http://bit.ly/1sn9BmN
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.