Powershell and Project Server Programmin

Tagged: , ,

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Guhanath Rajendran Guhanath Rajendran 7 months, 3 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #35030
    Profile photo of Guhanath Rajendran
    Guhanath Rajendran
    Participant

    All,
    I have written powershell script to connect to Microsoft Project server 2010 via web service call.
    I was able to get the list of the projects with all information. There is a method called ReadProjectEntities which takes 3 parameters(Guid, Task_Resource_Types, DataStoreEnum) to read project tasks and hours. I have written the code as below

    $pwaUrl = “https:///”
    $pwaPSUrl_Projectasmx = "/_vti_bin/PSI/Project.asmx?wsdl"
    $svcPSUrl = $pwaUrl + $pwaPSUrl_Projectasmx
    $pwaPROJECT_ENTITY_TYPE_TASK_AND_RESOURCE = $pwaPROJECT_ENTITY_TYPE_TASK -or $pwaPROJECT_ENTITY_TYPE_RESOURCE

    $myCred = Get-Credential

    $svcPSProxy = New-WebServiceProxy -uri $svcPSUrl -credential $myCred
    echo "proxy created"

    [System.Enum]$pwaDataStoreEnum = $svcPSProxy.DataStoreEnum # this not returning as enum.
    echo "Enum " $pwaDataStoreEnum.GetType() // this gives error.

    #equivalent method in ASPX page with C# code is below

    MyProjectWebReference.ProjectDataSet readProjDs = projectSvc.ReadProjectEntities(guid, PROJECT_ENTITY_TYPE_TASK_AND_RESOURCE, MyProjectWebReference.DataStoreEnum.WorkingStore);

    I even tried to Load Office.Project.Server.Library dll and use DataStoreEnum but that too failed. Anyone have thought about it or any suggestions?

    MSDN says DataStoreEnum is used from WebSvcProject but this wasn't easy in powershell. COuld be a simple thing but I have submitted this question in multiple forums but could not get any answer.

    Thanks
    Guhan

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.