So I've built a "script", to deploy using JAMF. It is pretty much a single command.
It looks like this:
dsconfigad -add "SERVERNAME" -force -computer "COMPUTERNAME" -domain "SELECTED_OU" -username "ADMIN" -password "SOMEPASSWORD"
When run, doesn't matter if from script in Jamf, or typed manually, it failes with error:
dsconfig: Authentication server could not be contacted. (5200)
The weirdest thing is it works immedietaly when doing it with GUI (preferences -> Users & Groups -> Login Options -> Network Account Server).
I tried to google it, but nothing seems to work (like an implication, there is some problem with time sync between server and MacOS computer). Any ideas, where to find the solution?