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?
Asked
Active
Viewed 5.9k times
5
-
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 Answers
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
stderr
- 10,264
- 2
- 32
- 49
-
I'm sure there's a log file (like in XP) that shows name changes...? – Kinnectus Jan 06 '15 at 19:58
-
-
1C:\Windows\debug\NetSetup.log ? It won't just show computer names because it's a log of the domain join process. No guarantee a full list, though. I've never needed to know so I only know it's "one" way of getting a hostname from a dead pc – Kinnectus Jan 06 '15 at 20:02
-
-
1Ah, probably because the computer hasn't joined a domain. I think you're out of luck I'm afraid. – Kinnectus Jan 06 '15 at 20:09
-
-
-
This key does not hold the correct value on more recent Windows versions. The Event Viewer method works. – cmo Jan 10 '23 at 22:11
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