Script to determine if a Windows 2012R2 server was upgraded from a previous ver

Hi All,

I am trying to figure a way to determine if a Windows 2012R2 server was upgraded from a previous version or a clean install. The servers in this environment predate me and there are over 2000 of them. It was reported to me that some local admins are complaining with issues that they attribute to the server being upgraded to 2012R2 instead of being build from scratch.

I need to find a way to determine if it was a upgrade or clean install, script it to run against all 2012R2 servers, and generate a report to mgmt with the results. I have looked online and do not see anything on how to make this distinction and figured with all the smart people we have in this group someone may have tackled this before.

Any tips or guidance is greatly appreciated as I can’t find much on this topic.

As always thanks in advance.


I think when you do a windows upgrade, it will automatically move all the previous version files to a windows.old folder. So you just test-path c:\windows.old you can determine if was a upgraded version or clean install.

Thanks Yuan,

I did search for the .old folder but I have seen at other places (and one of the other admins here) have said it is quite possible that they deleted that folder after the upgrade. I was hoping someone knew of a reg key or log file somewhere that would definitively say if it was upgraded or not.

I appreciate your help.