$strIPAddrTmp = "172.28.27.200"
$strKeyIEConnections = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\"
$strRegType = [Microsoft.Win32.RegistryHive]::CurrentUser
$strRegKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($strRegType, $strIPAddrTmp)
$strRegKey = $strRegKey.OpenSubKey($strKeyIEConnections)我使用上面的PS脚本尝试读取以下内容:
HKCU::Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings我只是尝试检查目标远程计算机的IE代理设置。我发现脚本总是从HKEY_USERS而不是HKEY_CURRENT_USERS返回内容。我做错了什么?
发布于 2013-11-26 14:42:46
这应该是答案!
1)找出登录机器的用户的SID。
$strSID = (Get-WmiObject -Class Win32_UserAccount -Filter "Domain = '$domain' AND Name = '$name'").SID 2)使用SID查找HKEY_USER中的信息:
$strKeyIEConnections = "$strSID\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\"
$strRegType = [Microsoft.Win32.RegistryHive]::Users
$strRegKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($strRegType, $strIPAddrTmp)
$strRegKey = $strRegKey.OpenSubKey($strKeyIEConnections)发布于 2013-11-25 16:52:39
您无法远程连接到当前用户配置单元。如果您知道用户的sid并通过HKEY_USERS配置单元连接到它,则可以。
发布于 2013-11-25 17:31:22
HKEY_USERS的子项是用户登录后实际挂载用户注册表配置单元(其配置文件中的ntuser.dat)的位置。HKEY_CURRENT_USER只是HKEY_USERS\S-1-5-...的别名,其中S-1-5-...是当前登录用户的SID。
https://stackoverflow.com/questions/20186778
复制相似问题