How To Update Project Site URL using CSOM (.Net) in Project Server 2016 ?? RRS feed

  • Question

  • Hi All,

    We are using Project Server 2016 , and want to update Project Site URL using CSOM (.Net).

    Please suggest possible solution.

    Earlier in PSI (2013) it was UpdateProjectWorkspaceAddress of Project.svc, but now i guess Project.svc is not availaible so cannot use the same.

    Please help with some solution, i want to update Project Site URL ,using CSOM (.Net).


    Sandeep Nandey

    Friday, December 16, 2016 1:56 PM

All replies

  • Hi Sandeep,

    Yes. we can do that, but 50% client side and 50% server side. Check below code

    first part - Get the project site URL using project server client object model (Microsoft.Projectserver.client)

    Second part - Update project site URL using SharePoint server side model. Because, we don't have property called 'Name' for SharePoint client side object model for web object. So we should use server side object model only.


    1. Project server client model won't support updating web url, hence I tried with SharePoint, because at the end project server site also one of the SharePoint site created by different template.

    try and let me know, if you found any issues.


    void Main(string[] args)



    Guid projGuid = new Guid("e77ce267-4bc1-e611-9a73-005056a3284d"); // replace with your project guid





    ProjectContext projContext = new ProjectContext("xxxxx"); //replace with pwa url



    PublishedProject pubProject = projContext.Projects.Where(proj => proj.Id == projGuid).FirstOrDefault();


                    projContext.Load(pubProject, p => p.ProjectSiteUrl);


    string projSiteUrl = pubProject.ProjectSiteUrl;


    using (SPSite site = new SPSite(projSiteUrl))



    using (SPWeb web = site.OpenWeb())


                            web.AllowUnsafeUpdates =

                            web.Name = "test1234";


                            web.AllowUnsafeUpdates = false;






    catch (Exception ex)




    Tuesday, December 20, 2016 5:49 PM
  • Hi vamsi,

    Thanks for the reply , but this will not solve my issue.

    Let me explain the scenario:

    1. By default Project Server creates the project site under PWA .( e.g.  /PWA/ProjectSite 

    2. But, I am having a Project Event Handler which creates the Project Site based on some custom field values [Selection Criteria] under different URL 

    eg. /PWA/SiteABC/SiteEFG/ProjectSite

    3. Now when we are doing this, we are not able to update the Project WorkSpace Address [Project Site URL] to the created site address [ /PWA/SiteABC/SiteEFG/ProjectSite] from event handler

    4. In Project Server 2013 PSI we are using UpdateProjectWorkspaceAddress method of Project.svc, which is i guess no loger available in Project Server 2016.

    So i am stuck here ,as i am not able to find any method to silimar to UpdateProjectWorkspaceAddress method of Project.svc

    Sandeep Nandey

    Wednesday, December 21, 2016 5:51 AM
  • Hi Sandeep,

    did you find a solution for this? Struggling with the same issue. Seems not to be possible.



    Christoph Muelder | Senior Consultant, MCTS, MCSE | SOLVIN information management GmbH, Germany

    Friday, December 30, 2016 2:37 PM
  • Hi Christoph,

    No, still not able to get the solution.

    As of now we are doing it manually from:

    PWA Setting > Operational Policies > Connected SharePoint Sites


    Sandeep Nandey

    Tuesday, January 10, 2017 4:14 AM
  • Have you found any solution to update the Project Site URL through code. Please help me.
    Wednesday, May 31, 2017 9:38 AM