During Covid we had a lot of Macs built offline, then before they were
sent to the users we logged onto our VPN and bound them to AD, then run:
sudo
/System/Library/CoreServices/ManagedClient.app/Contents/Resources/createmobileaccount
-n username to ...