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?
4 Answers
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.
- 81
- 1
- 3
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]
- 11
Event viewer event ID 6011 will be a computer name change, but the log will cull old entries so you can only see back so far.
But in general, all log entries record the current computer name. So you just need to find the oldest log entries to see the oldest computer names. Still this will have a limit on how far back you can go, but I do find that events in the Setup log seem to go back a bit further than the other ones.
- 232