虚位以待(AD)
虚位以待(AD)
首页 > 脚本专栏 > Powershell > Powershell实现从注册表获取用户配置脚本分享

Powershell实现从注册表获取用户配置脚本分享
类别:Powershell   作者:码皇   来源:互联网   点击:

这篇文章主要介绍了Powershell实现从注册表获取用户配置脚本分享,本文直接给出实现脚本源码,需要的朋友可以参考下

支持所有版本。

要获得本地用户的配置文件,可以使用这个脚本:

复制代码 代码如下:

$path = 'Registry::HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionProfileList*'
 
Get-ItemProperty -Path $path |
  Select-Object -Property PSChildName, ProfileImagePath

这将获得ProfileList下所有的键值并筛选出其中的SID和相应配置路径。

复制代码 代码如下:

PSChildName                              ProfileImagePath                       
-----------                              ----------------                       
S-1-5-18                                 C:WINDOWSsystem32configsystemprofile
S-1-5-19                                 C:WindowsServiceProfilesLocalService
S-1-5-20                                 C:WindowsServiceProfilesNetworkSer...
S-1-5-21-1907506615-3936657230-268413... C:UsersTobias                        
S-1-5-80-3880006512-4290199581-164872... C:UsersMSSQL$SQLEXPRESS               

相关热词搜索: Powershell 注册表 用户配置