Upon Checking, I found that the autodiscover internal URL was empty when i run the command get-AutodiscoverVirtualDirectory
When I try to reset with command Set-AutodiscoverVirtualDirectory -Identity <server_name> -InternalURL "https://test.doman.com/Autodiscover/Autodiscover.xml, there is an error :
The operation couldn't be performed because object
'<Exchange_Server>\Autodiscover' couldn't be found on 'ad.example.com'.
Although I set the preferred AD to another server, the same error still appear.
After quite some time I finally found a way to reset the Autodiscover virtual directory by running:
Get-ActiveSyncVirtualDirectory -Server <server_name> | Set-AutodiscoverVirtualDirectory -InternalURL https://test.doman.com/Autodiscover/Autodiscover.xml
Not sure what really happened but using this method seems able to reset the virtual directory.