Skip to main content
Question

AD Binding Script Troubleshooting

  • March 9, 2020
  • 2 replies
  • 10 views

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
  • March 10, 2020

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