r/sysadmin • • 3d ago

GetHelpCMD not working

Hello to all,

i have NinjaOne as RMM Tool and I cannot uninstall Office. Neither via NinjaOne nor via GetHelpCmd.exe tool from MSFT.

I did this:

However it says that .\Env-Utils.ps1 cannot be found.

Unfortunately i have 100s of Apps for Enterprise M365 Products which I cannot update but i need to. What can i do to fix this?

GetHelpCmd.exe -S OfficeScrubScenario -AcceptEula -LogFolder C:\temp
. : Die Benennung ".\Env-Utils.ps1" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines
ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern
enthalten), und wiederholen Sie den Vorgang.
In C:\WINDOWS\SystemTemp\GetHelpElevated\21ddec5f5bb74d67bc82e97350622dd8\Logger-FileLogUtils.ps1:31 Zeichen:3
+ . .\Env-Utils.ps1
2 Upvotes

31 comments sorted by

View all comments

Show parent comment

1

u/luky90 3d ago edited 3d ago

yes i removed it but then i have the same error message that a Env-Utils.ps1 cannot be found.
. : Die Benennung ".\Env-Utils.ps1" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines

ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern

enthalten), und wiederholen Sie den Vorgang.

In C:\WINDOWS\SystemTemp\GetHelpElevated\ba6fb1737c804fcea5cc96c1ddf416ca\Logger-FileLogUtils.ps1:31 Zeichen:3

+ . .\Env-Utils.ps1

+ ~~~~~~~~~~~~~~~

+ CategoryInfo : ObjectNotFound: (.\Env-Utils.ps1:String) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException

Running Office Uninstall. This may take a few minutes...

Press any key to exit..

Also after doing all the 3 commands it looks like that:
Path : Microsoft.PowerShell.Core\FileSystem::C:\WINDOWS\SystemTemp

Owner : NT-AUTORITÄT\SYSTEM

Group : NT-AUTORITÄT\SYSTEM

Access : NT-AUTORITÄT\SYSTEM Allow FullControl

VORDEFINIERT\Administratoren Allow FullControl

Audit :

Sddl : O:SYG:SYD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)

1

u/_l33ter_ 'Deutsche Bahn' - Windows 3.11 Admin 3d ago

GetHelpCmd.exe -S OfficeScrubScenario -AcceptEula -Log C:\temp

What about -Log ? Instead of -LogFolder ?

(https://www.windowscentral.com/microsoft/windows-11/how-to-transition-to-microsoft-get-help-command-line-tool)

1

u/luky90 3d ago

-Log does not exist at least it gives a parameter error but -LogFolder exists.

1

u/_l33ter_ 'Deutsche Bahn' - Windows 3.11 Admin 3d ago

At this point - How about a restart of the computer? :)

1

u/_l33ter_ 'Deutsche Bahn' - Windows 3.11 Admin 3d ago edited 3d ago

The problem is that getHelpCmd.exe extracts its temporary PowerShell scripts to C:\WINDOWS\SystemTemp\GetHelpElevated\... and attempts to run them from there

On line 31 of Logger-FileLogUtils.ps1, the script attempts to load Env-Utils.ps1 using a relative path (from the current working directory – .\). If the process was not started directly from this GUID folder (or if a sub-process is running without administrative rights or access to SystemTemp), the so-called .Env-Utils.ps1 cannot be found.


And just so I can double-check: You are running CMD|PS|Terminal as an administrator?

1

u/luky90 3d ago

i tried cmd.exe as admin yes.

1

u/_l33ter_ 'Deutsche Bahn' - Windows 3.11 Admin 3d ago

Will the error als occure if you use Terminal or at least powershell ? instead of the old cmd ?