Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to run powershell with elevated status?

danieldaeschle January 15, 2020

On a bamboo remote agent i want to run a script which contains this code:

Import-Module WebAdministration;
...

It worked until now (we updated to 6.10 recently).

 

The error that i get is this:

Import-Module : Process should have elevated status to access IIS configuration data.
At D:\bamboo-agent-home\temp\SC-SR7AR-TS-202-ScriptBuildTask-413057583993768370.ps1:1 char:1
+ Import-Module WebAdministration;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Import-Module], InvalidOperationException
+ FullyQualifiedErrorId : Module_ImportModuleError,Microsoft.PowerShell.Commands.ImportModuleCommand


Environment: Windows Server 2019 Datacenter
Bamboo: 6.10

The windows service runs as a user called "bambooagent" who is an administrator.

Could someone help me fixing this? i didn't find anything on the internet.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events