PowerShell one liner – Find user profiles on computer

Here I am again with new PowerShell one liner. This time I have a one liner that allows you to pull and see info on user profiles on the computer. This can be great tool if you trying to find out what obsolete profiles you may have on the machine and you are in process of clean up.

Get-ChildItem 'HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionProfileList'| get-itemproperty | select ProfileImagePath

Another good books with PowerShell subject:

. .

Post corrected based on comments from Jeffery Hicks the author of great book – Managing Active Directory with PowerShell – Thank you. As well he was kind to point out that you can use WMI in case you want to query profiles from remote machines by:

 get-wmiobject win32_userprofile

Thanks !!

3 Replies to “PowerShell one liner – Find user profiles on computer”

  1. Your code doesn’t match what you really ran. For anyone trying this you need to use the PowerShell registry provider path of HKLM: And you don’t need to use a ForEach loop with Get-ItemProperty, just use the pipeline.

    Get-ChildItem ‘HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionProfil eList’| get-itemproperty | select ProfileImagePath

    You can also get user profiles via WMI, which is handy when you want to query a remote machine:

    get-wmiobject win32_userprofile

    You might also take a look at http://www.scriptlogic.com/smbit/video/use-powershell-&-wmi-to-manage-user-profiles

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.