5

Does your computer store a list of all computer names it has had? For example, let's say your computer name is changed each reboot, would your computer somewhere have a list of all the previous computer names it has had?

user2676140
  • 2,075
  • 7
  • 30
  • 47
  • If you *want* to keep a record, whatever script/program is changing the name can keep a log – mpez0 Jan 06 '15 at 20:00
  • Hmmm...why would the computer be changing names can you elaborate a little more on this situation. – mdpc Jan 06 '15 at 20:28

3 Answers3

8

If the computer changed name recently, you can find it in the event viewer in Security, filter eventid 4648 . Then you can chose the date, and you will see what was the computer name at that time.

Félix M
  • 81
  • 1
  • 3
8

You can only find the last name of the computer, a list is not possible. Open the Registry Editor and navigate to the address:

HKLM\Software\Microsoft\SchedulingAgent\OldName

Source

stderr
  • 10,264
  • 2
  • 32
  • 49
1

This should search security log for your previous computer names that do not match your current one:

$SecLog=get-eventlog security -InstanceID 4648 | where {$_.MachineName -notlike "$Env:Computername"}

Then you can use that first variable to give you the whole list (probably lots of duplicates)

$AlloldNames=$SecLog.MachineName

This one will give you just the most recent old name that does not match your current one:

$MostRecentOldName=$SecLog.MachineName[0]
Jaron
  • 11
  • 1