Home > Paul Mather, Work > Update multiple #ProjectOnline PWA Instances using c# .Net console app #Office365 #csharpe #PPM #PMOT

Update multiple #ProjectOnline PWA Instances using c# .Net console app #Office365 #csharpe #PPM #PMOT

Paul Mather
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)

Following on from a post I wrote over a month ago regarding checking entities from multiple Project Online PWA instances, this post covers updating multiple Project Online PWA instances. The first post can be found below:

http://bit.ly/1GMeEUi

In this post I demonstrate a way in which you can manage configuration across multiple PWA instances, for example you might want to create a new custom field on more than one instance. This is a simple example just to show you the idea. As this is very much an example, I haven’t released any code or solution but you can see the core code further on in the post.

For the purpose of this blog post I created a C# .Net console application. Once you have a new visual studio console app project you will need to add the references to the following DLLs:

image

I used the v15 SharePoint and Project Server dlls here.

In the program add these dlls:

image

The first part of the code is to capture the custom field name and description plus the number of PWA instances to update:

image

It then goes into a loop to create the custom field on the specified PWA site:

image

The code below is used to secure the password in the console input:

image

That is it. This example will create a Project level custom field but you could easily update the code to get the user to enter the entity type (task / resource etc.)

To see this in action see below:

Enter the custom field name:

image

Enter the custom field description:

image

Enter the number of PWA instances to update:

image

Enter the first PWA site URL:

image

Enter the username for an account that has access to create custom fields:

image

Enter the password for that account:

image

After pressing enter it will go off and create the custom field on the first PWA instance:

image

Press any key and it will go back to ask for the 2nd PWA instance:

image

It will then prompt for the username and password as before. It will keep looping through depending on how many PWA sites needed to be updated.

On one of those PWA instances we can see the field was created:

image

Nice and easy, saves navigating around multiple PWA site collections for a simple change you might want to roll out across multiple instances.

Advertisements
Categories: Paul Mather, Work Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: