Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-14097

"Invoke-Command" in powershell script doesn't work when invoke it from bamboo task only

    • Icon: Bug Bug
    • Resolution: Low Engagement
    • Icon: Low Low
    • None
    • None
    • Windows

      See more details there
      https://answers.atlassian.com/questions/239823/invoke-command-in-powershell-script-doesn-t-work-when-invoke-it-from-bamboo-task-only

      Steps to reproduce

      Create Script task with PowerShell interpreter

      $session = New-PSSession
      Invoke-Command -Session $session -ScriptBlock {
          Start-Process "calc.exe"
      }
      

      Start agent on windows host under Administrative account
      Add requirement to created plan to be sure it's executed at started Windows agent
      Start plan

      Expected: calculator window
      Actual: nothing happened

            [BAM-14097] "Invoke-Command" in powershell script doesn't work when invoke it from bamboo task only

            Atlassian Update - 9 April 2025

            Hi,

            At Atlassian, our goal is to ensure we’re providing the best experience for our customers. With our new Data Center strategy, Atlassian's focus is on security, compliance, and performance and is a key driver in prioritizing bugs. Closing the bugs that do not fall into those categories will allow us to focus on the ones in the most current versions of our products.

            This bug is being closed due to a lack of engagement in the last four years, including no new watchers, votes, or comments; this inactivity suggests a low impact.

            Please note the comments on this thread are not being monitored.

            You can read more about our bug fix policy here and how we prioritize bugs.

            To learn more about our recent investments in Bamboo Data Center, please check our public roadmap.

            Kind regards,
            Bamboo Data Center

            Ishwinder Kaur added a comment - Atlassian Update - 9 April 2025 Hi, At Atlassian, our goal is to ensure we’re providing the best experience for our customers. With our new Data Center strategy, Atlassian's focus is on security, compliance, and performance and is a key driver in prioritizing bugs. Closing the bugs that do not fall into those categories will allow us to focus on the ones in the most current versions of our products. This bug is being closed due to a lack of engagement in the last four years , including no new watchers, votes, or comments; this inactivity suggests a low impact. Please note the comments on this thread are not being monitored. You can read more about our bug fix policy here and how we prioritize bugs. To learn more about our recent investments in Bamboo Data Center, please check our public roadmap . Kind regards, Bamboo Data Center

            Hi, Even I am also having the same issue. I am trying to connect another machine and delete some logs. My powershell script run from bamboo server if I run manually by opening the powershell command window as administrator. But where as not running from Bamboo task. Hope need to sort this problem.

            Thanks

            Omprakash Thamsetty added a comment - Hi, Even I am also having the same issue. I am trying to connect another machine and delete some logs. My powershell script run from bamboo server if I run manually by opening the powershell command window as administrator. But where as not running from Bamboo task. Hope need to sort this problem. Thanks

            Please, please, please get this sorted.

            Daniel Wessels added a comment - Please, please, please get this sorted.

            Ben Bailey added a comment -

            James, I dont think this issue has anything to do with the specific "Invoke-command" verb... to my knowledge, when you use the default windows 2008 server image for EC2 provided by Bamboo... the "Bamboo" user is not an administrator... and therefore, when the bamboo user tries to run powershell commands that require admin access, they fail.

            Ben Bailey added a comment - James, I dont think this issue has anything to do with the specific "Invoke-command" verb... to my knowledge, when you use the default windows 2008 server image for EC2 provided by Bamboo... the "Bamboo" user is not an administrator... and therefore, when the bamboo user tries to run powershell commands that require admin access, they fail.

            Hi there,

            Just to get clarification, is this issue really about being to run as a different user when invoking powershell or is it not possible to use invoke-command?

            Thanks
            James

            James Dumay added a comment - Hi there, Just to get clarification, is this issue really about being to run as a different user when invoking powershell or is it not possible to use invoke-command? Thanks James

            Couldn't agree more. We're using Bamboo to deploy to Azure, which requires access to the certificate store on the machine. Not running as administrator causes it to fail.

            Jason Taylor added a comment - Couldn't agree more. We're using Bamboo to deploy to Azure, which requires access to the certificate store on the machine. Not running as administrator causes it to fail.

            If this bug is about how powershell is not run as an administrator user when using the "Bamboo" user to run scripts... then please fix this urgently. This is blocking us significantly.

            Ben Bailey added a comment - If this bug is about how powershell is not run as an administrator user when using the "Bamboo" user to run scripts... then please fix this urgently. This is blocking us significantly.

            Powershell script should be run as administrator from Bamboo plan. In other case nothing doesn't work

            Andrey AndreySh added a comment - Powershell script should be run as administrator from Bamboo plan. In other case nothing doesn't work

            Also when i try to make this comand "powershell Start-Process PowerShell -Verb RunAs" i recived:
            07-Dec-2013 00:13:03 Start-Process : This command cannot be executed due to the error: This operatio
            07-Dec-2013 00:13:03 n requires an interactive window station.
            powershell script should be run as administrator from bamboo plan

            Andrey AndreySh added a comment - Also when i try to make this comand "powershell Start-Process PowerShell -Verb RunAs" i recived: 07-Dec-2013 00:13:03 Start-Process : This command cannot be executed due to the error: This operatio 07-Dec-2013 00:13:03 n requires an interactive window station. powershell script should be run as administrator from bamboo plan

              Unassigned Unassigned
              11ce614cbefc Andrey AndreySh
              Affected customers:
              8 This affects my team
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: