Skip to main content
Question

AD Binding Script Troubleshooting


Forum|alt.badge.img+3

I've been tasked with keeping an existing Jamf installation working that was setup by someone else. There was a script in place to bind machines in AD and then place them in their proper OU based on machine type (desktops or laptops). It stopped working all of a sudden.

I'm getting the following error:

Script exit code: 2 Script result: /Library/Application Support/JAMF/tmp/AD Binding - Bind WorkStations(WS) and LapTops(LT) with their proper OUs: line 16: conditional binary operator expected /Library/Application Support/JAMF/tmp/AD Binding - Bind WorkStations(WS) and LapTops(LT) with their proper OUs: line 16: syntax error near `$type' /Library/Application Support/JAMF/tmp/AD Binding - Bind WorkStations(WS) and LapTops(LT) to with their proper OUs: line 16: `if [[ [[ $type == "MacBook" ]]; then' Error running script: return code was 2.

The relevant part of the script is as follows:

# This if statement the OU for the computer if [[ [[ $type == "MacBook" ]]; then OU="OU=Laptops,OU=Devices,OU=CORP" elif [[ $type != "MacBook" ]]; then OU="OU=Desktops,OU=Devices,OU=CORP" fi

Does that look okay? Am I missing something? Thanks in advance for any help.

2 replies

Forum|alt.badge.img+2

You have duplicate opening brackets '[[' at the start of your if statement


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 8 replies
  • March 10, 2020

That was it. Been staring at it too long I guess. Thank you!


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