We've managed to keep Windows 10 off of the majority of the computers we manage because it breaks mission critical applications, however, we're attempting to write a procedure that will let us know if we missed anything. The only problem is that the procedure does not work as intended; I've stripped it down to just the very basics, and yet it still continues to work incorrectly (note it's not failing to work, it just never does what Kaseya says it's going to do). Does anyone have any insight as to why this always returns that the file is not detected, even though I'm looking right at it?
To go a step further, if I remove the else statement, the procedure executes correctly, as far as Kaseya is concerned; however I'm never given a pop-up box saying that the file exists.
If testFile("C:\Windows\System32\GWX\GWX.exe) Exists
sendMessage("Exists", "Display now", "All Operating Systems", "Halt on fail")
sendMessage("Does not exist.", "Display now", "All Operating Systems", "Halt on fail")
I assume you are logged into the machine and the message is displaying. I prefer the write procedure log entry to test this as well.
Try a Repply Schema. I've recently had problems with an "If getOS()" command, where it would just fail on any machine, and doing a re-apply schema fixed it.
Correct, I'm just testing it on my machine, I'm logged in, and an administrator (running as user vs system seems to have no effect on the outcome of this snippit).
For these purposes (I'm just testing this one small part of the script on my machine) would there be any benefit to using procedure log entries over send message other than just best practices?
I'm going to check on reapplying the schema, or testing on another machine to see if anything changes.
Can you share a screenshot of the agent procedure log with the related steps regarding the procedure above?
If you're interested, We have done something similiar, We figured out that the update can be on the machine, and not have the computer update to win10. The box used to download and update it can be just stopped and it wont update, also it wont show updates pending in Wuapp.
I wonder if perhaps the scripting engine can't see the file? What happens if you write a script to simply do a dir of that directory to a file i.e "dir c:\windows\system32\gwx" > c:\some directory\test.txt