Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,091
Community Members
 
Community Events
168
Community Groups

How to run powershell with elevated status?

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

Atlassian Community Events