Can you check if the Service account you are using has the necessary permissions and is in the root domain. You can refer to below guide to verify the permissions needed.
Thank you for the response.
Currently, the service account resides in root domain with directory replication permissions. As far as i know for Domain discovery the service account does need Domain Admin privileges.
Could you please confirm the same? If No , what are the appropriate privileges a service account should have to retrieve all DCs into FOREST_DETAILS after successful ADSI COnnection.