如何使用 PowerShell 检索系统中的所有用户配置文件?
所有新用户配置文件都保存在 windows 系统的路径中,
'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\'
要检索所有用户配置文件,我们可以使用
gci 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\' | ForEach-Object { $_.GetValue('ProfileImagePath') }ProfileImagePath 属性显示了用户配置文件的位置。
检索用户配置文件的另一个方法是使用 WMI。
PS C:\> gwmi win32_userprofile |Select -ExpandProperty LocalPath
输出
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
广告
数据结构
网络技术
关系型数据库管理系统(RDBMS)
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程语言
C++
C#
MongoDB
MySQL
Javascript
PHP