https://www.saotn.org/windows-server-2012-r2-disk-cleanup-dism/

  1. Open and elevated command prompt and run:
     dism.exe /online /Cleanup-Image /AnalyzeComponentStore 

    to get info on when the last cleanup was done and other misc info.

  2. To perform a basic cleanup run:
     dism.exe /online /Cleanup-Image /StartComponentCleanup