Jump to content
Sean

Call "Refresh Searches" and "Do Group Refresh" in a script.

Recommended Posts

Is it possible to call "Refresh Searches" and or  "Do Group Refresh" from within a script?  I'm hoping it's something i can do in SQL.  

 

image.png.968441fe17ecf60ca39f99ef4a43c89c.png

 

I have an internal monitor that detects when new computers are installed and i want to pragmatically call the refresh searches and groups to try and speed up the on-boarding processes.

 

Thanks,

Share this post


Link to post
Share on other sites

It’s possible yes, but II don’t think it’s that great of an idea. ESPECIALLY if you are new to Automate, you wouldn’t know what problems can be caused or how to gracefully coordinate things. I’m thinking for example, what will your solution do when you are onboarding a client and 3-33 new machines get registered within a short window. Will your solution end up trying to rebuild groups and searches 30 times? Will that break all your internal monitors if they timeout while tables are locked? I’ll be honest and say that I don’t know all the trouble it would cause, but as someone who has used Automate for about 7 years and is familiar with many internal details at a level matched by few outside of the developers, my recommendation would be to reconsider your approach.  Forcing these group and search refreshes are not things that you should need to routinely do.

Share this post


Link to post
Share on other sites

Let me just clarify that Darren is not over exaggerating or being arrogant when he states his level of knowledge and skill. Disobey at your own risk. 😁

Share this post


Link to post
Share on other sites

@MGreen Oh, i do trust Darren. He's been super helpful and has been able to help me with multiple issues so far. You guys always have great advice and are awesome.  

@DarrenWhite99 That is a really good point about multiple computer's being registered at the same time causing the automate db to lock. No clue how that slipped my mind. It's just tough as we have over 300 + support staff that will be installing systems, where today they can install and access the machine's immediately with our current software but once we move to Automate they have to wait anywhere from 30 minutes to an hour. Some of our staff is driving 3 to 6 hours to install this software and the worst part is that connectwise's response is just sit and wait, "because we have nothing better to do". Note: We're not an MSP and there is no one there to install the software for us and it requires some extra validation and testing on site for our machines.

I wish i would have noticed this issue but during testing everything was done as system admin. 

Thanks,

Sean K  

Edited by Sean

Share this post


Link to post
Share on other sites

I have an “onboarding accelerator” monitor. It triggers the onboarding script when it sees:

A computer, online, in a location with onboarding enabled where onboarding has not completed and excluded from contract is not selected.

I specifically use the v_extradata tables to test the EDF values because as soon as I can see the result there, I know that groups and such have rebuilt. (I tried triggering it quicker, but the standard onboarding script relies on groups/EDFs/etc. being up to date, so running it early means it misses things). That doesn’t speed the group builds, but it does start onboarding within about 20 minutes instead of only running once an hour. 

So, is the main issue that users are granted access to machines by specific groups, and the machines are not visible to them until the computer is in that group? A potential solution could be: Create a group that determines which agents they can see. Say you are using “Service Plans” as the group. You could have a search/group for “Agents Under Contract” or whatever, that just grabs all computers where the location has a server or workstation (as appropriate) service plan assigned with onboarding enabled and Exclude From Contract is not checked.  Basically, it will be all computers that should be under contract. Ok, now, make a monitor that runs every 5 minutes to check if any not onboarded systems matched those conditions.. Trigger a script. (I think you already had all this design in mind) but instead of rebuilding EVERYTHING, just add a row to searches, subgroups and subgroupswchildren for the agent, adding the agent to the specific group(s) you need them in for technicians to access them.  This would scale because you are only performing minor insert queries instead of asking for everything to be rebuilt for only one new agent. Not everything would be complete, but you could get them the access they need. (Oh yeah, also, some users permissions table would need to be touched..)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...