All bmw E39 comes with OBD connector. It is located on the right hand side when the storage compartment is.
Just detach the latch and you be able to see the connector.
Bro J....the earlier e39 ('96-'98 kot....not sure) like mine,the connector is the ole round one in the engine bay.the later ones are in the cabin where u mentioned .square connector.