If using a retail channel product key you can;
DISM /online /Set-Edition:<edition ID> /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula
where <edition ID> = ServerStandard or ServerDataCenter
--please don't forget to Accept as answer if the reply is helpful--