支持所有版本。
要獲得本地用戶的配置文件,可以使用這個腳本:
代碼如下:
$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
新聞熱點
疑難解答