支持所有版本。
要獲得本地用戶的配置文件,可以使用這個腳本:
復制代碼 代碼如下:
$path = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\*'
Get-ItemProperty -Path $path |
Select-Object -Property PSChildName, ProfileImagePath
這將獲得ProfileList下所有的鍵值并篩選出其中的SID和相應配置路徑。
復制代碼 代碼如下:
PSChildName ProfileImagePath
----------- ----------------
S-1-5-18 C:\WINDOWS\system32\config\systemprofile
S-1-5-19 C:\Windows\ServiceProfiles\LocalService
S-1-5-20 C:\Windows\ServiceProfiles\NetworkSer...
S-1-5-21-1907506615-3936657230-268413... C:\Users\Tobias
S-1-5-80-3880006512-4290199581-164872... C:\Users\MSSQL$SQLEXPRESS
您可能感興趣的文章:- Powershell從注冊表中查詢默認MAPI客戶端的例子
- PowerShell注冊表操作命令總結
- PowerShell使用Remove-Item命令刪除文件、注冊表項介紹
- PowerShell小技巧之查找獲取注冊表路徑
- Powershell小技巧之獲取注冊表值的類型
- Powershell讀取本機注冊表中的所有軟件關聯擴展名
- Powershell實現從注冊表獲取本地關聯文件的擴展名
- 使用PowerShell修改注冊表