- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get all the 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
- Related Articles
- How to get all the processes on remote computers using PowerShell?
- How to get the disabled local user accounts using PowerShell?
- How to disable windows firewall profiles using PowerShell?
- Creating User roles and profiles in SAP system
- How to get the system files using the Get-ChildItem in PowerShell?
- How to get all the Get-Process properties using PowerShell?
- How to get all the processes on the local computer with Get-Process command using PowerShell?
- How to get the System uptime with PowerShell?
- How to block ports on the Windows Operating System using PowerShell?
- How to get all the services based on their status in PowerShell?
- How to get all the aliases in PowerShell?
- How to change the local user account password using PowerShell?
- How to set the local user account settings using PowerShell?
- How to find the locked local user accounts using PowerShell?
- How to add the user to the local Administrators group using PowerShell?

Advertisements