Automating the World

We have migrated servers, if you encounter any issues, please let us know on Slack, or post it.


We have also disabled registration as we migrate to the new forum systems. The slack (slack.labtechgeek.com) will always be accepting new users.
 
yellowadmin
Topic Author
Posts: 3
Joined: Tue Sep 23, 2014 5:13 am

Script to search for software and modify EDF

Mon Jul 31, 2017 4:06 am

Hi,

I have created an EDF (checkbox) which will be ticked if a certain piece of software is installed. The aim is to be able to create a script which will search an agent for the software, and if it's installed update the EDF from 0 to 1, and if not installed keep the EDF as 0.

I have tried creating the above but have come across a few issues and haven't had much success. Can anyone please advise if they have done something similar or point me in the right direction?

Many thanks,
Yellowadmin
 
User avatar
phmcgann
Posts: 7
Joined: Fri Nov 04, 2016 11:23 am
Current LT Agent Count: 10000+

Re: Script to search for software and modify EDF

Mon Jul 31, 2017 12:50 pm

Why not do something like this:

  • Create a search that searches just for that software + also for the EDF NOT being checked.

    search-falseEDF_softwareinstalled.png

  • Create a second search that searches just for that software + also for the EDF actually being checked.

    search-trueEDF_softwareinstalled.png

  • Create a group, limit the group to only add endpoints from the first search where it's finding the software + no EDF checked.
  • Create a second group, limit the group to only add endpoints from the second search where it's finding the software + EDF checked.
  • Create a one-liner script that does "ExtraData Set Value" for whatever your Extra Field you created is (presumably it's a computer EDF, so ensure it has the -1 at the end), and put %computerid% in the ID box, and then set the Value to 1. Something like this below as shown in screenshot. A value of 1 with the checkbox EDF will be "checked/True" while a value of = should be "not-checked/False"

    2017-07-31 13_15_57-Script.png

  • Add a script to the first group to run that script you just created, like every few hours or something, so that it checks the box of that EDF. It will then remove it from the first group so that the script doesn't run on the endpoint anymore. The second group will now add the agent that had the script run on it as the EDF box is now checked.
You do not have the required permissions to view the files attached to this post.
 
User avatar
DarrenWhite99
Geek
Posts: 514
Joined: Wed Jun 04, 2014 11:17 pm
Current LT Agent Count: 1500+
Location: Redding, California, US

Re: Script to search for software and modify EDF

Tue Aug 01, 2017 4:23 am

That's an excellent walkthrough. See also http://www.labtechgeek.com/forum/viewtopic.php?f=14&t=2361#p15479 for more discussion on automating processes with LabTech.
 
yellowadmin
Topic Author
Posts: 3
Joined: Tue Sep 23, 2014 5:13 am

Re: Script to search for software and modify EDF

Tue Aug 01, 2017 9:05 am

Hi guys,

Thanks for the prompt responses.
Phmcgann - your suggestion pointed me in the right direction, many thanks. It took a little more tweaking but we now have a solution in place for what we wanted!
Darren - nice in-depth post on automating PC deployments. We have something like this in place and it's made life so much easier!

I'll give a quick run through on what we were trying to achieve overall, in hope that it assists anyone else that may be looking for a similar solution. We have recently migrated to ESET v6 which uses the remote administrator agent to allow workstations to talk back to the administrator server. After initially running an agent deployment task ,around 50% of our machines installed the product. Our aim was to automate the process of installing the agent software, for whenever a new agent joined a client or for current agents which did not have the software installed after the initial push.

- First off I created searches based on phmcgann's post.
- The first search checked for agents where the EDF was set to false (0).
- Created a group for this search to look at, along with the script phmcgann advised on - setting the EDF value to 1.
- Next, I created a search for each of our clients. This search contained x3 conditions - 1) EDF field Is False, 2) Client Name =, 3) LabTech.IsOnline Is True
The third option was to save the deployment we would eventually use running against offline agents.
- Once the individual client searches had been created, I created a group for each client and limited the group to look at this search only.
- Finally created the deployment tasks in the ESET plugin, one for each client, and configured as a persistent task.

I hope the above manages to help someone in a similar situation! Many thanks for your help.
 
User avatar
DarrenWhite99
Geek
Posts: 514
Joined: Wed Jun 04, 2014 11:17 pm
Current LT Agent Count: 1500+
Location: Redding, California, US

Re: Script to search for software and modify EDF

Tue Aug 01, 2017 2:19 pm

A suggestion to cut down on the number of clients and groups required. Create a client level EDF named "Enable ESET Deployment". Instead of a different group and search for each client, one search can check "If Client-EDF "Enable ESET Deployment"=1 (Is checked)", along with the other EDF field. Then to enable a new client, you can just change the Client EDF value, and now that client will be included. One script can include whatever logic is needed if there are different commands used depending on which client is being targeted, or ideally can dynamically handle the differences. Say a different product key is used per client. You could test for each client, and if it matches the client for that agent, set the key to a hardcoded value. But if that key was stored in a Client-EDF, then the script would not need to be changed to support each new client. You would just need to place the Client Key into that EDF and check the "Enable ESET Deployment" EDF, and the script would be able to incorporate what makes that client unique with the parts of the install that are always the same. Your search could also include a test for the "Client Key" EDF to ignore agents with "Enable ESET Deployment" enabled that do not have a valid "Client Key", since the install steps will fail anyways.

Another thought: If you are scheduling a repeating script against a group, you can select the "Skip Offline" agents option in the scheduling parameters. This eliminates the need for your search to distinguish between online and offline agents. It also makes the group membership more informative by including all agents that are out of compliance, even if they are offline at the moment.
 
mcretari
Posts: 5
Joined: Wed Aug 03, 2016 12:49 pm
Current LT Agent Count: 500+

Re: Script to search for software and modify EDF

Wed Aug 09, 2017 8:26 am

yellowadmin wrote:
Hi guys,

- Finally created the deployment tasks in the ESET plugin, one for each client, and configured as a persistent task.



Hi
How did you do to configure the task as persistent?

ESET Dashboard only allows me to mark as persistent Deploy tasks, but not migration tasks.

Thank you