
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get All User Profiles on the System Using PowerShell
All the new user profiles are created on the windows system at the path,
'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\'
To retrieve all the user profiles, we can use
gci 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\' | ForEach-Object { $_.GetValue('ProfileImagePath') }
ProfileImagePath property shows the location of the user profiles.
Another way to retrieve the User Profile is using WMI.
PS C:\> gwmi win32_userprofile |Select -ExpandProperty LocalPath
Output
C:\Users\.NET v2.0 Classic C:\Users\.NET v4.5 Classic C:\Users\.NET v2.0 C:\Users\.NET v4.5 C:\Users\Classic .NET AppPool C:\Users\Administrator.AUTOMATIONLAB C:\Users\delta
Advertisements