#210496 - 2015-08-07 02:32 AM
Re: If exist file then delete with Wildcards
[Re: hroberts89436]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
|
What you need is the "Secure Admin Install Suite". This handy-dandy script "cures what ails ya"! (and no Snake Oil!)
Here's the general idea: Your (non admin) user needs to do something that requires admin rights.. install an app, delete a file, whatever.. but you ain't granting no admin rights to them - no-siree-sir!
You use the SAIS (noted above) - you write a small script that is invoked during logon to DETECT if the admin task is needed. That script uses the SAIS API to drop a request on one of your servers - no admin rights needed. (that share can be WRITABLE by all users, but not readable!)
The SAIS service, running on the server, gets the request, verifies it, then looks up the task that was requested. Lickety-split - it sends a script back to the requesting computer and, using the Task Scheduler, defines a Task and immediately executes it with the appropriate admin rights.
So - where can you get this magical application, you ask??? Well, right here on KORG! Just mosey on over to the Script Vault (Click the Forums link, then scroll to the bottom of the forum list).
Now - this does require some coding on your part. The monitor service is fully coded, and the API provides a couple of functions and example code to communicate to the SAIS server. YOU have to write the part of the code that determines if something has to be done, and use the API to submit the request. YOU also need to define the config file on the server that maps the request to actual install/delete/whatever script (which YOU have to write) and the credentials to use - but that's actually the easy part!
Your current script can determine if the files that need to be deleted exist - so use the API to request the "DelFiles". You write a script that deletes the files and verify that it works with admin rights. That script is sent to the system that requested it and it runs with the credentials you specify.. you just need the detect and action scripts, and these can be developed/tested independently.
There's a ZIP in the script vault thread that contains the service, samples, the API function library, and some documentation. I've used this at several clients to deploy apps triggered via my login script over the years. Once set up, you can do all kinds of cool things without ever giving end-users admin rights!
At one client, we actually created a web-based menu of apps that were available for self-service install. I used VBScript to write the request file, but Kix handled the rest. It's built on my tcLib library that interfaces to the Task Scheduler. Be aware that there is a newer version of tcLib that uses SchTasks instead of JT (from the resource kit). I don't recall what version is in the SAIS ZIP file, so you might want to update it if it uses JT.exe. Just replace on tcLib.kxf file with the newer one - they're 100% function compatible.
Give it a go, and post your examples and questions here..
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 657 anonymous users online.
|
|
|