cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.

Run a script after a user is bound to a device

AntiSanti
Novitiate I

Hello everyone,

I am looking to find a way to run a command/ script whenever a user is bound to a device.

I am trying to add users to a local device group that has R/W access to a folder for Slack updates.

I suppose I could create a script that runs once a day. Checks if the users on that machine are a part of the local group, if they are, exit, if not then add them to the group. However, I think it would be better to have it just ran once a user is bound.

 

Thanks!

4 REPLIES 4

urvashi
Community Manager Community Manager
Community Manager

Hi @AntiSanti one thing you could try is looking for the systemuser_update event in Directory Insights. 

Full disclosure, I've never used it but hoping it could work as a first step? 

AntiSanti
Novitiate I

So I have done some more digging and found the event logs that I was looking for. What I needed was an association change! The user_update doesn't show when a user is bound to a device. However, association_change shows when a resource is updated to another resource. Doing some more filter, you can add association_operation: add, association to type: user, and association from type: system. Those 3 give you when a user is bound to a system.

Now my dilemma is finding out how to get a command to run based off of when when there is an event log that meets that filter criteria. Any input on that?

urvashi
Community Manager Community Manager
Community Manager

From what I've heard (i.e. other people discussing this in our community) is that you'd have to push those logs to an app that can alert you when the event happens and set up a trigger from there. One of our community members shared a tutorial for how he sets up his automations if you'd like to take a look: https://community.jumpcloud.com/t5/community-scripts/inactive-user-report-on-all-systems/m-p/3437

urvashi
Community Manager Community Manager
Community Manager

You can also comment under that post and tag the community member who made the tutorial and ask for recommendations ๐Ÿ™‚