Fwd: Get AD container information

rmanly
Contributor III

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 3

noah_swanson
New Contributor

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

noah_swanson
New Contributor

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

rmanly
Contributor III

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