使用 Powershell 远程访问注册表

使用 Powershell 远程访问注册表

我想使用 Powershell 脚本远程访问 Windows 机器的注册表以查看“SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform”下的某些键

我已经尝试打开 PSSession,但没有成功。还有其他解决方案吗?

答案1

$Computer = "RemoteComputerName"

$Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $Computer)
$RegKey= $Reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SoftwareProtectionPlatform")
$RegValue = $RegKey.GetValue("UserOperations")

确保远程计算机上的 RemoteRegistry 服务已启用并启动,要更改注册表配置单元,请使用以下命令之一:

https://msdn.microsoft.com/en-us/library/ctb3kd86(v=vs.110).aspx

相关内容