Important, to be able to enter the domain, the VPN connection must be working.
We must start the VPN connection with the system administrator user, once the VPN connection is activated we can join the domain.
When we restart the system, to enter the domain, we must first start the local user session and connect the VPN,
without closing the local session with which we have connected the VPN,
we use the change user option and start our session with the domain user .
If we have configured the option to remember the data of connected users,
we can start the session without being connected to the domain,
this can cause security problems. We can use the windows autolon tool to automate the VPN connection.
This solution is best suited for multi-user computers.
Link:
https://learn.microsoft.com/es-es/sysinternals/downloads/autologon
OpenVPN's connection automation script:
timeout 5
cd C:\Program Files\OpenVPN\bin\
openvpn-gui.exe --connect example.ovpn
Save to C:\Users\My-User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup as .bat or .cmd
Note: So far I haven't been able to connect to OpenVPN without logging in, I guess it's due to the nature of the app that needs to be launched graphically.
I will continue investigation