Hello all!
I am trying to set up a scheduled task to publish all items in Project 2013 and could use some assistance.
The script I am running:
$svcPSProxy = New-WebServiceProxy -uri "https://MYPWAURL/PWA/_vti_bin/PSI/Project.asmx?WSDL" -UseDefaultCredential $EPMTYGUID = [system.guid]::empty $ProjectList = $svcPSProxy.ReadProjectStatus("$EPMTYGUID","WorkingStore","", "0").Project | format-table proj_uid -hidetableheaders | out-string -stream foreach ($projectUid in $projectList) { if ($projectUid -ne "") { $G = [System.Guid]::NewGuid() $svcPSProxy.QueuePublish("$G", $projectUid, "true","")}}
But I am running into an error:
Exception calling "ReadProjectStatus" with "4" argument(s): "The request failed with HTTP status 401: Unauthorized."
At C:\inetpub\wwwroot\ScheduleScripts\PublishAllScript.ps1:3 char:1
+ $ProjectList = $svcPSProxy.ReadProjectStatus("$EPMTYGUID","WorkingStore","", "0" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
I've tried everything I can think of to get around the unauthorized error. Running from the PWA farm account, made sure it has full rights on the project side. Tried hard coding the USER\Pass, launching the window PS1 in an instance with provided account, etc.
I am running this from the APP server. If someone has a better script, please post, or if someone has some modifications to the existing one I would be super grateful.
Thanks!