[GH-ISSUE #1359] Bug: running scripts and sending commands on Microsoft Exchange Servers #848

Closed
opened 2026-03-02 02:19:26 +03:00 by kerem · 26 comments
Owner

Originally created by @rawbyne on GitHub (Dec 2, 2022).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1359

Server Info (please complete the following information):

  • OS: Ubuntu Server 20.04
  • Browser: chrome 108
  • RMM Version (as shown in top left of web UI): 0.15.3

Installation Method:

  • Standard
  • Docker

Agent Info (please complete the following information):

  • Agent version (as shown in the 'Summary' tab of the agent from web UI): 2.4.2
  • Agent OS: Windows Server 2016

Describe the bug
If I run a powershell script on this server, which is an exchange-server, I get the following error:
exec: "Powershell": cannot run executable found relative to current directory

I reinstalled the wohle agent, the powershell.exe is available in c:\windows\system32, DISM and SFC Check made with no problems, Server has been restarted several times.

To Reproduce
Steps to reproduce the behavior:
Because I do not know, how the procedure looks like to start the powershell script, I can not reprocedure this. On all other systems I got, the scripts start, but not on this.

Expected behavior
The scripts should run.

Screenshots
no

Additional context
none

Originally created by @rawbyne on GitHub (Dec 2, 2022). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1359 **Server Info (please complete the following information):** - OS: Ubuntu Server 20.04 - Browser: chrome 108 - RMM Version (as shown in top left of web UI): 0.15.3 **Installation Method:** - [ ] Standard - [x] Docker **Agent Info (please complete the following information):** - Agent version (as shown in the 'Summary' tab of the agent from web UI): 2.4.2 - Agent OS: Windows Server 2016 **Describe the bug** If I run a powershell script on this server, which is an exchange-server, I get the following error: exec: "Powershell": cannot run executable found relative to current directory I reinstalled the wohle agent, the powershell.exe is available in c:\windows\system32, DISM and SFC Check made with no problems, Server has been restarted several times. **To Reproduce** Steps to reproduce the behavior: Because I do not know, how the procedure looks like to start the powershell script, I can not reprocedure this. On all other systems I got, the scripts start, but not on this. **Expected behavior** The scripts should run. **Screenshots** no **Additional context** none
kerem closed this issue 2026-03-02 02:19:26 +03:00
Author
Owner

@dinger1986 commented on GitHub (Dec 2, 2022):

What happens if you try and run a powershell command via send command or remote background?

It's not an issue I have noticed on my 2016 agents but don't have any running exchange.

Have you got AV on the server? Could that be blocking it?

<!-- gh-comment-id:1334920879 --> @dinger1986 commented on GitHub (Dec 2, 2022): What happens if you try and run a powershell command via send command or remote background? It's not an issue I have noticed on my 2016 agents but don't have any running exchange. Have you got AV on the server? Could that be blocking it?
Author
Owner

@rawbyne commented on GitHub (Dec 2, 2022):

Wow. You are fast ;-)

The terminal starts. If I type "powershell", powershell terminal starts. So no problem

<!-- gh-comment-id:1334945388 --> @rawbyne commented on GitHub (Dec 2, 2022): Wow. You are fast ;-) The terminal starts. If I type "powershell", powershell terminal starts. So no problem
Author
Owner

@dinger1986 commented on GitHub (Dec 2, 2022):

Did you try right clicking on the agent and then send command, choose powershell and even just send a ping command

<!-- gh-comment-id:1334948720 --> @dinger1986 commented on GitHub (Dec 2, 2022): Did you try right clicking on the agent and then send command, choose powershell and even just send a ping command
Author
Owner

@rawbyne commented on GitHub (Dec 2, 2022):

If i use "send command", then use "powershell", command = "ping 1.1.1.1", I get a "bad request" after Timeout.

<!-- gh-comment-id:1334952982 --> @rawbyne commented on GitHub (Dec 2, 2022): If i use "send command", then use "powershell", command = "ping 1.1.1.1", I get a "bad request" after Timeout.
Author
Owner

@dinger1986 commented on GitHub (Dec 2, 2022):

Can you share a screenshot?

Does this work in other 2016 servers for you?

<!-- gh-comment-id:1334957538 --> @dinger1986 commented on GitHub (Dec 2, 2022): Can you share a screenshot? Does this work in other 2016 servers for you?
Author
Owner

@rawbyne commented on GitHub (Dec 2, 2022):

More info about AV: AV = Defender, Path Exclusions are set.
c:\program files\Mesh Agent
C:\program files\TacticalAgent
c:\programdata\TacticalRMM

<!-- gh-comment-id:1334958152 --> @rawbyne commented on GitHub (Dec 2, 2022): More info about AV: AV = Defender, Path Exclusions are set. c:\program files\Mesh Agent C:\program files\TacticalAgent c:\programdata\TacticalRMM
Author
Owner

@rawbyne commented on GitHub (Dec 2, 2022):

screenshot
screenshot2

<!-- gh-comment-id:1334960865 --> @rawbyne commented on GitHub (Dec 2, 2022): ![screenshot](https://user-images.githubusercontent.com/12291375/205257300-fec1ed7b-1c8b-449b-a382-1341a8f1e727.png) ![screenshot2](https://user-images.githubusercontent.com/12291375/205257573-499b932e-4c15-47fc-802b-0498f8636bfa.png)
Author
Owner

@dinger1986 commented on GitHub (Dec 2, 2022):

Try the same command with cmd please

<!-- gh-comment-id:1334962215 --> @dinger1986 commented on GitHub (Dec 2, 2022): Try the same command with cmd please
Author
Owner

@rawbyne commented on GitHub (Dec 2, 2022):

I got no Problems on all other servers.

CMD = Same error

<!-- gh-comment-id:1334963138 --> @rawbyne commented on GitHub (Dec 2, 2022): I got no Problems on all other servers. CMD = Same error
Author
Owner

@rawbyne commented on GitHub (Dec 2, 2022):

I setup an account for you, if you want to test!

<!-- gh-comment-id:1334965804 --> @rawbyne commented on GitHub (Dec 2, 2022): I setup an account for you, if you want to test!
Author
Owner

@dinger1986 commented on GitHub (Dec 2, 2022):

Are they showing online? If you cant use send command for cmd or powershell there's something wrong and scripts won't run.

Click through the tabs in remote background do they all load?

<!-- gh-comment-id:1334966388 --> @dinger1986 commented on GitHub (Dec 2, 2022): Are they showing online? If you cant use send command for cmd or powershell there's something wrong and scripts won't run. Click through the tabs in remote background do they all load?
Author
Owner

@dinger1986 commented on GitHub (Dec 2, 2022):

I setup an account for you, if you want to test!

I could maybe this evening.

<!-- gh-comment-id:1334967285 --> @dinger1986 commented on GitHub (Dec 2, 2022): > I setup an account for you, if you want to test! I could maybe this evening.
Author
Owner

@rawbyne commented on GitHub (Dec 2, 2022):

All loading. Agent is online. No other problems, but the scripts....
How to give the credentials to you?

<!-- gh-comment-id:1334968903 --> @rawbyne commented on GitHub (Dec 2, 2022): All loading. Agent is online. No other problems, but the scripts.... How to give the credentials to you?
Author
Owner

@dinger1986 commented on GitHub (Dec 2, 2022):

Best on discord

<!-- gh-comment-id:1335182690 --> @dinger1986 commented on GitHub (Dec 2, 2022): Best on discord
Author
Owner

@rawbyne commented on GitHub (Dec 6, 2022):

Ola. Did you find something?

<!-- gh-comment-id:1338881187 --> @rawbyne commented on GitHub (Dec 6, 2022): Ola. Did you find something?
Author
Owner

@dinger1986 commented on GitHub (Dec 6, 2022):

I replied yesterday, I don't have permissions to see/run anything

<!-- gh-comment-id:1338944255 --> @dinger1986 commented on GitHub (Dec 6, 2022): I replied yesterday, I don't have permissions to see/run anything
Author
Owner

@rawbyne commented on GitHub (Dec 6, 2022):

Sorry, now you are admin

<!-- gh-comment-id:1338999199 --> @rawbyne commented on GitHub (Dec 6, 2022): Sorry, now you are admin
Author
Owner

@dinger1986 commented on GitHub (Dec 6, 2022):

Thanks, I just logged in there, this seems to be an issue on all your exchange servers (I searched for EX in the search box), I right clicked and clicked send command, then ping 8.8.8.8 and send. On every single one they time out, 2012 r2, 2016 and 2019.

I have one client who also has an exchange server (most are on 365 now) and I can confirm the same behaviour but I can run scripts on it and I see you can run scripts on your other exchange servers just not on that one you have specified so something must be blocking access to powershell for Tactical Agent as it works from remote background, maybe check AV again. Ill discuss the send commands though as theres something strange about that and get back to you if we need access again but for now please close my account.

<!-- gh-comment-id:1339045198 --> @dinger1986 commented on GitHub (Dec 6, 2022): Thanks, I just logged in there, this seems to be an issue on all your exchange servers (I searched for `EX` in the search box), I right clicked and clicked `send command`, then `ping 8.8.8.8` and `send`. On every single one they time out, 2012 r2, 2016 and 2019. I have one client who also has an exchange server (most are on 365 now) and I can confirm the same behaviour but I can run scripts on it and I see you can run scripts on your other exchange servers just not on that one you have specified so something must be blocking access to powershell for Tactical Agent as it works from remote background, maybe check AV again. Ill discuss the send commands though as theres something strange about that and get back to you if we need access again but for now please close my account.
Author
Owner

@dinger1986 commented on GitHub (Dec 6, 2022):

can you also rename this to Bug: running scripts and sending commands on Microsoft Exchange Servers

<!-- gh-comment-id:1339046314 --> @dinger1986 commented on GitHub (Dec 6, 2022): can you also rename this to `Bug: running scripts and sending commands on Microsoft Exchange Servers`
Author
Owner

@dinger1986 commented on GitHub (Dec 6, 2022):

@rawbyne I edited above as I checked the running scripts and its only one server thats giving the powershell error, its maybe worth checking the exclusions etc incase something is blocking powershell.exe execution, mesh background finds and executes powershell fine.

<!-- gh-comment-id:1339200703 --> @dinger1986 commented on GitHub (Dec 6, 2022): @rawbyne I edited above as I checked the running scripts and its only one server thats giving the powershell error, its maybe worth checking the exclusions etc incase something is blocking powershell.exe execution, mesh background finds and executes powershell fine.
Author
Owner

@rawbyne commented on GitHub (Dec 6, 2022):

Hi there, I checked the exclusions. All is fine.

<!-- gh-comment-id:1339217551 --> @rawbyne commented on GitHub (Dec 6, 2022): Hi there, I checked the exclusions. All is fine.
Author
Owner

@dinger1986 commented on GitHub (Dec 6, 2022):

can you please provide the following:

(Get-MpPreference).ExclusionPath

<!-- gh-comment-id:1339225814 --> @dinger1986 commented on GitHub (Dec 6, 2022): can you please provide the following: `(Get-MpPreference).ExclusionPath`
Author
Owner

@rawbyne commented on GitHub (Dec 6, 2022):

Screenshot 2022-12-06 131928

<!-- gh-comment-id:1339240729 --> @rawbyne commented on GitHub (Dec 6, 2022): ![Screenshot 2022-12-06 131928](https://user-images.githubusercontent.com/12291375/205910936-c61e7c28-3628-4f53-9f93-69320c587d09.png)
Author
Owner

@dinger1986 commented on GitHub (Dec 6, 2022):

can you try them with \* afterwards, whats the results of the same command on another machine?

<!-- gh-comment-id:1339691082 --> @dinger1986 commented on GitHub (Dec 6, 2022): can you try them with `\*` afterwards, whats the results of the same command on another machine?
Author
Owner

@dinger1986 commented on GitHub (Dec 6, 2022):

thanks @rawbyne made progress and testing fix on machines prior to rolling out an update

<!-- gh-comment-id:1340117135 --> @dinger1986 commented on GitHub (Dec 6, 2022): thanks @rawbyne made progress and testing fix on machines prior to rolling out an update
Author
Owner

@rawbyne commented on GitHub (Dec 7, 2022):

If you want to, feel free testing it on my server

<!-- gh-comment-id:1340458362 --> @rawbyne commented on GitHub (Dec 7, 2022): If you want to, feel free testing it on my server
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#848
No description provided.