An RPC error most likely means that there is no proper communication betweeen the client and the server or that the server is unavailable.
For ports required for ADCS, here's a post:
https://support.microsoft.com/en-us/help/832017#method4
Additionally, you could enable debug (with addebug) and try the adcert command again and look at the created log file.
R.P