amidaware / tacticalrmm

A remote monitoring & management tool, built with Django, Vue and Go.
https://docs.tacticalrmm.com
Other
3.24k stars 444 forks source link

Not a real Bug: MeshCentral cant be installed on Win11 24H2 #1901

Open maieredv-manuel opened 4 months ago

maieredv-manuel commented 4 months ago

Server Info (please complete the following information):

Installation Method:

Agent Info (please complete the following information):

Describe the bug Its not a real bug ... i dont know if this is a known "problem" ... but ive got a message that i cant install TRMM on a fresh installed Win11 24H2, because MeshCentral isnt supported on 24H2. Its because 24H2 hasnt installed/enabled WMIC by default. When installing manually via cmd with "-nomesh" argument, installation is OK.

Expected behavior It not a real problem with TRMM, so ive would like if there is a option to set "nomesh" for the EXE-installer. And/or is it possible (as a workaround) to implement the installation of WMIC in the EXE-Installer, if there are also dependencies from TRMM to WMIC!?

dinger1986 commented 4 months ago

Ok, so this is more a feature request than a bug, you would like either WMIC to be checked and then installed prior to mesh install or when generating the exe installer be able to hard code nomesh rather than having to do that manually.

For now I guess you can create a powershell installer that will work with a deployment link and some variables and have the -nomesh flag set in it

maieredv-manuel commented 4 months ago

Ah, yes ... sure - sorry for that.

Yes, that would be nice when there were an option for enbaling automatic installation of WMIC (for the moment until all dependencies are solved - i think MS will remove WMIC sooner or later in a upcoming release).

Aah, okay, i see with the deployment Methode its easy with "nomesh" argument. Thats for that info!

dinger1986 commented 4 months ago

so soemthing like this from https://docs.tacticalrmm.com/install_agent/#scripting-agent-installation:

Invoke-WebRequest "<deployment URL>" -OutFile ( New-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force )
$proc = Start-Process c:\ProgramData\TacticalRMM\temp\trmminstall.exe -ArgumentList '-silent' -PassThru -nomesh
Wait-Process -InputObject $proc

if ($proc.ExitCode -ne 0) {
    Write-Warning "$_ exited with status code $($proc.ExitCode)"
}
Remove-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force

Or if we wanted to be really smart we could change the powershell script to detect if wmic is installed and install it if its not detected, then Exit if it doesnt install

# Check if WMIC is available
$wmicPath = "C:\Windows\System32\wbem\WMIC.exe"

if (Test-Path $wmicPath) {
    Write-Output "WMIC is installed. Installing TRMM now"
} else {
    Write-Output "WMIC is not installed. Installing TRMM without Mesh, you want to install WMIC for full functionality"
Invoke-WebRequest "<deployment URL>" -OutFile ( New-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force )
$proc = Start-Process c:\ProgramData\TacticalRMM\temp\trmminstall.exe -ArgumentList '-silent' -PassThru -nomesh
Wait-Process -InputObject $proc

if ($proc.ExitCode -ne 0) {
    Write-Warning "$_ exited with status code $($proc.ExitCode)"
}
Remove-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force
}
Invoke-WebRequest "<deployment URL>" -OutFile ( New-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force )
$proc = Start-Process c:\ProgramData\TacticalRMM\temp\trmminstall.exe -ArgumentList '-silent' -PassThru
Wait-Process -InputObject $proc

if ($proc.ExitCode -ne 0) {
    Write-Warning "$_ exited with status code $($proc.ExitCode)"
}
Remove-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force
maieredv-manuel commented 4 months ago

Ive done it this way: (in "-ArgumentList")

`Invoke-WebRequest "" -OutFile ( New-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force ) $proc = Start-Process c:\ProgramData\TacticalRMM\temp\trmminstall.exe -ArgumentList '-silent -nomesh' -PassThru Wait-Process -InputObject $proc

if ($proc.ExitCode -ne 0) { Write-Warning "$_ exited with status code $($proc.ExitCode)" } Remove-Item -Path "c:\ProgramData\TacticalRMM\temp\trmminstall.exe" -Force`

For now "nomesh" is needed for installation on 24H2, because even if WMIC is installed MeshCentral wont install on 24H2.

Are there any dependencies on TRMM side for WMIC? If no, then it should be OK for the Moment. But i think it would be nice to have the option for skipping the MeshCentral installation via GUI!?

dinger1986 commented 4 months ago

ah ok, no it shouldnt effect using TRMM but some of the data is collected using WMI so you might have some incomplete data on the machine until its install, I have adjusted the If statement above then to just install with nomesh

maieredv-manuel commented 4 months ago

So the new Script cheks if WMIC is installed, when not (probably only on 24H2), it installs with "nomesh" argument!? When WMIC is installed (all others), it installs without "nomesh" argument!?

Am i right?

dinger1986 commented 4 months ago

yeah thats right

maieredv-manuel commented 4 months ago

Thank you!

wh1te909 commented 4 months ago

to be clear, wmic.exe is going away, not WMI. tactical agent does NOT use wmic.exe to collect data, it queries the WMI database, so tactical isn't affected at all. unfortunately it appears the mesh agent shells out to executables and parses the output to gather info, which is never a good way to do things.

johnnyq commented 4 months ago

There currently is an open issue for this in MeshCentral Git Issues See here https://github.com/Ylianst/MeshCentral/issues/6162

Not clear if its actively being working on though

How will this affect Windows 11 Machines updating to 24H2 will they break?

maieredv-manuel commented 4 months ago

What ive seen until now it only a problem when you are installing the TRMM Agent on a fresh installed 24H2 Machine. But when you have activated the WMIC Feature you can install TRMM with Mesh enabled.

bbrendon commented 1 month ago

@wh1te909 is the trmm agent installer going to be updated to install wmic.exe ? Or do we need to update our install process ourselves to install it first?

dinger1986 commented 1 month ago

I know it was being looked at by Si as all the wmic commands can be replaced with native powershell commands.

I looked out all the commands and started checking the powershell alternatives then Si mentioned he was looking at it so I left it.

Happy to work on this as part of a group via the mesh or tactical discord.

wh1te909 commented 1 month ago

The installer/mesh works for me on 24H2 even though wmic is gone. I need to be able to reproduce the issue so I can fix the installer. What am I missing here?

chrome_QIKVcUrRuE

PS C:\Users\tactical> (Get-ItemProperty "HKLM:\Software\Microsoft\Windows NT\CurrentVersion").LCUVer
10.0.26100.1742
time="2024-10-06T14:33:50-07:00" level=info msg="Downloading mesh agent..."
time="2024-10-06T14:33:51-07:00" level=info msg="Installing mesh agent..."
[...Checking for previous installation of "Mesh Agent" [NONE]
...Installing service [DONE]
   -> Writing firewall rules for Mesh Agent Service... [DONE]
   -> Starting service... [OK]
 ]
time="2024-10-06T14:33:59-07:00" level=info msg="Adding agent to dashboard"
time="2024-10-06T14:34:09-07:00" level=info msg="Installing service..."
time="2024-10-06T14:34:10-07:00" level=info msg="Starting service..."

c:\cds>wmic
'wmic' is not recognized as an internal or external command,
operable program or batch file.
wh1te909 commented 1 month ago

This is a freshly installed 24H2 just downloaded the latest ISO today, so not an upgrade.

Astorek86 commented 1 month ago

On a freshly installed Win11 24H4, it's possible to install WMIC through the Settings-App. After that, the Agent works fine again.

wmic

wh1te909 commented 1 month ago

I don't have wmic installed, but the agent still works. Trying to figure out why it still works for me, but nobody else.

johnnyq commented 1 month ago

@wh1te909 Im going to Install 24h2 directly on a virtual Machine and give it a shot, ill let you know what the outcome is.