Skip to main content
Question

Fwd: Get AD container information

  • February 26, 2010
  • 3 replies
  • 30 views

Forum|alt.badge.img+12

networksetup throws that error when running without root privs.

but

dscl localhost -read /Active Directory/All Domains/Computers/`scutil —get
ComputerName` dn

works too.

3 replies

Forum|alt.badge.img+8
  • Contributor
  • March 2, 2010

Here’s the script I’m attempting to run:

#!/bin/sh

# Assign Recon Field
ADlocationField="-department"

# Sets Computer Name var
GetLoc=scutil --get ComputerName

# Set location var
ADvalue=dscl localhost -read /Active Directory/All Domains/Computers/$GetLoc dn | sed -e 's/dsAttrTypeNative:dn://g'

# Displays Location
echo "Current Active Directory Location: $ADvalue"

# Sends data to Recon
/usr/sbin/jamf recon $ADlocationField "$ADvalue"

When I run the script and update recon, after “Locating Hardware Information” I receive:
sh: line 1: 4954 Trace/BPT trap /usr/sbin/dsconfigad –show >&/private/tmp/49410.tmp

Any thoughts?

Thanks!
Noah


Forum|alt.badge.img+8
  • Contributor
  • March 2, 2010

Here’s the script I’m attempting to run:

#!/bin/sh

# Assign Recon Field
ADlocationField="-department"

# Sets Computer Name var
GetLoc=scutil --get ComputerName

# Set location var
ADvalue=dscl localhost -read /Active Directory/All Domains/Computers/$GetLoc dn | sed -e 's/dsAttrTypeNative:dn://g'

# Displays Location
echo "Current Active Directory Location: $ADvalue"

# Sends data to Recon
/usr/sbin/jamf recon $ADlocationField "$ADvalue"

When I run the script and update recon, after “Locating Hardware Information” I receive:
sh: line 1: 4954 Trace/BPT trap /usr/sbin/dsconfigad –show >&/private/tmp/49410.tmp

Any thoughts?

Thanks!
Noah


Forum|alt.badge.img+12
  • Author
  • Contributor
  • March 3, 2010

Ran just fine for me in 10.6.2 and 10.5.8 but it does not update the dept.
field in my JSS. Maybe the dept. field can only be changed to something that
is already listed in "Departments" under the "Settings" tab in the JSS?

Keep up the good fight!

Ryan M. Manly
Glenbrook High Schools
? ACSP ? ACMT