您现在的位置是:网站首页> 编程资料编程资料
Powershell实现从注册表获取用户配置脚本分享_PowerShell_
2023-05-26
373人已围观
简介 Powershell实现从注册表获取用户配置脚本分享_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实现从注册表获取本地关联文件的扩展名_PowerShell_
- PowerShell中实现播放WAV音频文件_PowerShell_
- PowerShell实现获取进程所有者_PowerShell_
- Powershell中打开网页实例_PowerShell_
- Powershell实现按类型排序_PowerShell_
- Powershell读取本机注册表中的所有软件关联扩展名_PowerShell_
- Powershell截取字符串并添加省略号的例子_PowerShell_
- Powershell使用C#实现缩写路径_PowerShell_
- PowerShell中iso8601格式日期和DateTime对象互转实例_PowerShell_
- Powershell中显示隐藏文件的方法_PowerShell_
