Install .NET Framework 4 (or 4.6) in Windows Server 2016

Try to to install .NET Offline using DISM like in this example for .NET 3.5:

Type the following command: “Dism /online /enable-feature /featurename:Netfx3 /source:D:\Sources\sxs” and then press enter. It take a while and when the process has finished, close the PowerShell Windows then go to check the exact windows features must be installed successfully.

Thank you @JackLock for this comment:

So based on your suggestion, I enabled feature called "NetFx4". Since it was already installed, I didn't need to provide source of it. So my command looked like

Dism /online /Enable-Feature /FeatureName:NetFx4 /All