policy deployment based on custom event "hostname" change

darylr
New Contributor II

17c7216893ab4fc5ad485bc7b836b93a
Is there anyway to specify this field to use the "hostname" change as a custom event to deploy the policy? Thanks in advance everyone

2 REPLIES 2

mm2270
Legendary Contributor III

That field isn't used to trigger policies based on events that happen on the device itself, other than the one example shown in the help string that I'm aware of. It's really for setting up a custom name or trigger that can be called in a scripted workflow or by invoking it in the Terminal. Something like sudo jamf policy -event joinToAD or the like.

If you want to run policies based on hostname change, then Jamf already provides a solution with the Network State Change trigger, which will get run on computer name change, and IP changes as a couple of examples.

c86621596cdb40bf9e7805292446756a

But be aware that this trigger gets called pretty frequently, because it watches changes to a folder that unfortunately ends up being modified under a variety of circumstances, not just on hostname or IP change.
Given this, you might want to use a script that can run on the network state change to see if the policy really needs to be run or not, and then you can use the custom event trigger in another policy to call the actual workflow if needed.

darylr
New Contributor II

ok cool! i will give it a shot. thanks for the response