Visual Studio Team Services - release definition - run task (PowerShell) as admin Visual Studio Team Services - release definition - run task (PowerShell) as admin powershell powershell

Visual Studio Team Services - release definition - run task (PowerShell) as admin


I don't think there is a way to do that using PS task. Can you try "Run PS on target servers" and provide admin creds. You will need to provide the machine name of the agent (so this is not ideal) as an input to the task. That might not require UAC. We will file this as a feature request.


I ran into this same problem. To fix it I did this (YMMV):

  1. I uninstalled the Azure DevOps agent
  2. Verified that the agent user was an admin
  3. Reinstalled the Azure DevOps agent

When I originally installed the agent, the user the agent was running as was not an admin (I added that user to the Builtin\Administrators group after I installed the agent). I'm not sure if that caused a problem, but uninstalling/reinstalling solved it for me.


I do not think that the Inline or Path options are the issue. Maybe installing an Agent in the Deployment Environment Machine, assigning in the installation process the credentials of a user you are sure has administrative privileges on the SharePoint farm could help you. Then in VSTS verify that the agent is Online and working in the Deployment Group Section.