Hi Everyone,
I am still learning the ways of shell scripting and how to best implement them in my Caper environment. I have the following scenario and would appreciate some examples from the community.
In my environment we prefix computer names with their geographical location. Example: aucomputer1 would be a computer in the Austin region. The prefix can be 2 or 4 characters depending on location, so I'm thinking I need to read the first 2, see if it matches my criteria, and if not read the first 4. We also have our AD structure broken down into geographical OUs. For the Austin example we have an AU OU that the computer would live under.
I would like to create a policy for binding to AD. In that policy I want to read the first 2/4 characters of the computer name and then via triggers, initiate the appropriate binding that assigns the computer to the appropriate OU.
EXAMPLE 1: Bind AUCOMPUTER1 to AD > shell script parses first 2 characters = AU > jamf policy -trigger BindAU (assigns to AU OU).
EXAMPLE 2: Bind HOMECOMPUTER1 to AD > shell script parses first 2 characters = HO = no match > shell script parses first 4 characters = HOME > jamf policy -trigger BindHOME (assigns to HOME OU).
