
$profileList = ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList’ Next, I use the Get-ChildItem cmdlet ( dir is an alias) to list the registry profile keys: In the code that follows, I first store the path to the registry (using the HKLM Windows PowerShell drive) in a variable. However, due to the length of registry keys, I am going to do it in two lines. I can enumerate the profile keys in a single command. Using Windows PowerShell, it is really easy to get and to display registry keys. The registry location viewed in the Registry Editor appears in the following figure. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList The registry location did not change in Windows 7, so the VBScript would still work. A few years ago (actually more like six years ago), there was a Hey, Scripting Guy! Blog post entitled Hey, Scripting Guy! How Can I List All the User Profiles on a Computer? That post talks about enumerating a registry key to find the profile information. Can this be done using Windows PowerShell?

I found a Hey, Scripting Guy! post to do this, but it uses VBScript. Hey, Scripting Guy! I would like to find a good way to see which profiles exist on my laptop. Summary: Learn how to use Windows PowerShell to find all user profiles on a computer, and to display the date when each profile was last used.
