Comments (11)
Hi @openmoto,
I'm currently working on variable substitution at the script / mesh / node level, which I think would work for what you're attempting here. I was thinking more manual entry, but the idea to pull variables from MeshCentral relative to the node sounds excellent as well and I'll have to include that.
I'm also working on functionality that will allow you to save a file to the server from the agent via ScriptTask (e.g. save the file C:\Windows\Temp\myfile.csv to My Files / Root / Group Name / file_name.csv, which may also work instead of having each script email results (unless of course it's going to someone without MeshCentral access, but I'm also trying to integrate a server-side email function to ScriptTask as well).
So it's entirely possible and coming (albeit slowly, I have a lot on my plate right now).
from meshcentral-scripttask.
Thanks for the quick update.
Yes, that's what I was hoping to achieve. The information would have to be entered manually initially and possibly also kept up to date manually. Once it's set for each mesh or node, then the script could run as many times as needed always pulling the provided information.
I took your advice on the other post, which is sufficient for me as of now as I'm able to select options in powershell based on the mesh name.
It's not an urgent matter, just trying to see if there's anything available I can take advantage of.
It would be great to be able to store passwords/secrets that will be hidden from everyone but the admin user, so even if a non admin user is allowed to run scripts, they can utilize the passwords without actually seeing them. I've just started trying out Microsoft.PowerShell.SecretsManagement and seems like a good way to store those locally per machine and safely. It seems to be very new so thought I'd mention it here in case it's useful.
Thanks
from meshcentral-scripttask.
Hi @openmoto,
Variables have been introduced in the latest version, give it a whirl and let me know what you think. I'll wait a few days before closing this out as fulfilled.
from meshcentral-scripttask.
Hi @ryanblenis,
I think I'm missing it. I've upgraded to ScriptTask 0.0.14, I don't see where to set the variables.
Any quick tips on how to set and use the variables from script?
Thanks
from meshcentral-scripttask.
It's in the bottom-right (under Script History) and there is a [ + ] sign to add variables. Reference them in a script by using #variableName#
More info on parse order, etc. can now be found in the ReadMe
Let me know if that isn't clear enough or you think there could be clearer instructions to help people. Thank you!
from meshcentral-scripttask.
Really odd.
Here's what mine looks like
I've tried Firefox and IE, chrome incognito and cleared my chrome cache just to be sure it's not some weird issue on chrome.
Just finally removed and reinstalled the plugin but doesn't seem to be coming up for me.
from meshcentral-scripttask.
Odd, and you're updated to 0.0.14? I wonder if there's a caching issue with the browser. Can you check the version, and if you're up to date, open chrome dev tools and on the Network tab check "Disable cache" and then reload the page (with dev tools open).
If that doesn't work, try uninstalling / re-installing the plugin so it gets a fresh copy (all your data will still be there).
from meshcentral-scripttask.
Hmmm..
I tried all that and it didn't seem to help.
Then I updated from 0.4.9-k to 0.4.9-o and it just showed up!
I think all I needed to do in the first place was restart meshcentral?
I'll do some testing this week and report back.
from meshcentral-scripttask.
@ryanblenis ,
First test just worked, substituting variable in powershell script. No issues at all.
I have a suggestion, though I'm assuming you probably have something in the works for some of it.
-
When creating variables, is it possible to add a checkmark "Hide Value" or "Is Secret"?
Just to make the value hidden behind **** -
Possibly prevent non admin from editing or viewing script content as well as variables.
if the first one is done without the second, someone can easily edit script to display or write the password to a location they can read. -
Possibly hide variables completely from users that are not Administrators?
I'll try create new non-admin user to test further.
Thanks for the great work so far.
I understand you're doing this on your personal time and it takes a lot of work, so I'm very happy with what's available now.
from meshcentral-scripttask.
Interesting on the restart loading the updated interface, do you have Nginx or a reverse proxy in front of MeshCentral? I wonder if there is caching going on there, because the file that serves that content is served from disk at every page load.
I agree there should be some secrets preservation, but I need to find the best way to accomplish this across OS's, which could be as you mention, preventing certain users from editing / viewing scripts and variables. Of course, the scripts are written (however temporarily) to disk on the agents during script execution. Powershell has ConvertTo-SecureString
, but bash and cmd do not. Let me see what I can come up with.
from meshcentral-scripttask.
Update:
I upgraded script task on a different server (Windows server 2012 R2 and mesh central 0.4.9-k and it seemed to just work.
I didn't have any reverse proxy setup on the initial server, just a plain Ubuntu 18.04 x64 VPS with meshcentral.
from meshcentral-scripttask.
Related Issues (20)
- Installation failing with "value not defined" error HOT 4
- no longer working after mesh v0.9.19 HOT 6
- Unable to install plugins, even after updating server to the 'fixed' version
- Feature:Target Nodes by tag
- getScriptTree error HOT 17
- Feature request: Tags in scripts
- No vertical scroll bar when number of scripts exceed window height
- -
- Bypass ExecutionPolicy HOT 2
- High CPU usage with ScriptTask plugin enabled HOT 2
- Cant get the plugin to install HOT 3
- Reboot loop in Linux
- Schedule task to launch as soon as agents are connected
- Memory leak
- Error instantiating new plugin: Error: Cannot find module 'mongodb
- Dark Mode Compatibility HOT 2
- Enhancement: Python 3.x Execution enablement?
- only allow a specific group to use this
- unable to scroll down list of tasks HOT 1
- Install Issues - Internal Server Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meshcentral-scripttask.