none
Powershell - Change owner project server 2013 RRS feed

  • Question

  • Dear ,

    I create project by powershell

    cls
    $a = (Get-Content C:\Users\spsservice\Documents\list.txt);
    $b = $a.Count;
    
    foreach ($d in $a)
    {
        #Get details for new project
        $ProjTempName = "Enterprise Project"
        $ProjEPTName = "Enterprise Project"
        Write-host "The Project is called $d"
        #Project PSI Web Service 
        $svcPSProjProxy = New-WebServiceProxy -uri "https://server/pwa/_vti_bin/PSI/Project.asmx?wsdl" -useDefaultCredential
        #Get the Project Template UID from the ReadProjectStatus Method
        #$projTempGuid = $svcPSProjProxy.ReadProjectStatus("BE27D811-2F37-E411-BF07-001F294E1E37","WorkingStore",$ProjTempName, "0").Project | format-table proj_uid -hidetableheaders | out-string -stream
        $projTempGuid = $svcPSProjProxy.ReadProjectStatus("e07f111e-7b3d-e411-940a-005056b46baa","WorkingStore",$ProjTempName, "0").Project | format-table proj_uid -hidetableheaders | out-string -stream
        
        Write-Host $projTempGuid
        #Create the new project using the CreateProjectFromTemplate method
        $NewProjGUID = $svcPSProjProxy.CreateProjectFromTemplate("$projTempGuid", $d)
        
        #Create a new GUID
        $G = [System.Guid]::NewGuid()
        #Publish the new project using the QueuePublish method
        $svcPSProjProxy.QueuePublish("$G", "$NewProjGUID", "true","")
        Write-host -ForegroundColor Green "********* $d has now been created *********"
        #update EPT for newly created project
    }

    But i want change project owner by powershell. Please help me!!

    And add value for enterprise and custom fields  

    Example :

    Project Name: Demo

    Department: HR (choice)

    Result : Finish (choice)

    Owner : supportA

    I created project Demo , but I don't add valued for fields (Department,Result ,Owner )

    Blog: http://e-sharepoint.blogspot.com/

    Skype : tin.trung.8x

    Thanks,

    Tuesday, September 16, 2014 10:34 AM

All replies