Skip to main content
Question

Extended Attribute - Using a Computer's IP Address


Forum|alt.badge.img+9

Need to look up an ldapsearch attribute based on to create an extended attribute via a script and need to utilize the computer's IP Address. Can I access that in a script? If so how?

3 replies

mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • August 19, 2014

You might need to clarify what you're looking for. Do you need the Mac to get its own IP address in the script? Or are you trying to get that information out of your JSS in your script?


Forum|alt.badge.img+9
  • Author
  • Contributor
  • 37 replies
  • August 25, 2014

I'd like to have the script get the ip address from the computer record in the jss database.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • August 25, 2014

OK, so what information do you have regarding the Mac or Macs in question that you need to pull this info from the JSS? Computer name? Serial #? MAC Address? Several of these?

The way to do this would involve using the Casper API, calling the Mac's record via a script and parsing the data you need, in this case, the IP address reported to the JSS.

Rather than me posting some lengthy example, take a look at this thread, where Chris has posted a link to his blog on how to pull specific information from an API record. You can adapt that script to get the reported IP address back and then use that as a variable in your ldapsearch.
https://jamfnation.jamfsoftware.com/discussion.html?id=7052

Post back if you get lost along the way, but it should at least point you in the right direction.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings