Powershell实现从注册表获取用户配置脚本分享
2019/7/10 21:23:47
本文主要是介绍Powershell实现从注册表获取用户配置脚本分享,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
支持所有版本。
要获得本地用户的配置文件,可以使用这个脚本:
复制代码 代码如下:
$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实现从注册表获取用户配置脚本分享的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2022-09-14SharePoint 2019 用 PowerShell将启用发布功能站点网站集另存为模板
- 2022-08-30PowerShell教程 - 程序性能和BUG分析工具
- 2022-08-30PowerShell教程 - 模块管理(Modules Management)
- 2022-08-29PowerShell教程 - Web requests(Web请求)
- 2022-08-26PowerShell教程 - 日期时间管理(Date & Time Management)
- 2022-08-25PowerShell教程 - 磁盘与硬件管理(Disk & Hardware Management)
- 2022-08-25PowerShell教程 - 系统事件管理(System Event Management)
- 2022-08-25PowerShell教程 - 文件系统管理(File System Management)
- 2022-08-24PowerShell教程 - 网络管理(Network Management)
- 2022-08-24PowerShell