AD Binding Script Troubleshooting

carlito
New Contributor II

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 2

andrew_abraham
New Contributor II

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

carlito
New Contributor II

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