'远程注册表(RemoteRegistry)'无法启动

时间:2016-09-30 13:00:15

标签: powershell

我一直收到RemoteRegistry错误,我想知道如何解决这个问题。我已经尝试将我的代码缩短到一行甚至只是启动服务但由于某种原因我一直收到这个错误:

Start-Service : Service 'Remote Registry (RemoteRegistry)' cannot be started due
to the following error: Cannot open RemoteRegistry service on computer 'IT-Tech'.
At line:1 char:59
+ Get-Service -Name RemoteRegistry -ComputerName IT-Tech | Start-Service
+                                                          ~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand

代码:

Get-Service -Name RemoteRegistry -ComputerName IT-Tech | Start-Service

我只是不明白我为什么一直

  

Get-Service:找不到任何具有服务名称的服务' remoteregistry'。

1 个答案:

答案 0 :(得分:1)

默认情况下,禁用RemoteRegistry。可以使用以下方法查看:

Get-Service RemoteRegistry | Select-Object StartType

要启用它,可以使用Set-Service命令:

Get-Service -ComputerName <Remote Computer> -Name RemoteRegistry | Set-Service -StartupType Manual -PassThru| Start-Service

要再次禁用:

Get-Service -ComputerName <Remote Computer> -Name RemoteRegistry | Set-Service -StartupType Disabled -PassThru| Stop-Service