Powershell实现从注册表获取用户配置脚本分享
时间:2021-04-29 10:55:56|栏目:|点击: 次
支持所有版本。
要获得本地用户的配置文件,可以使用这个脚本:
复制代码 代码如下:
$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
上一篇:SQL嵌套查询总结
栏 目:
下一篇:docker 容器上编译 go 程序提示找不到文件问题
本文标题:Powershell实现从注册表获取用户配置脚本分享
本文地址:http://www.codeinn.net/misctech/111003.html






