Skip to content

Instantly share code, notes, and snippets.

@Nora-Ballard
Created February 15, 2014 13:34
Show Gist options
  • Save Nora-Ballard/9019405 to your computer and use it in GitHub Desktop.
Save Nora-Ballard/9019405 to your computer and use it in GitHub Desktop.
function Repair-RemoteRegistryService($ComputerName)
{
# Tries to Start the Remote Registry Service, and returns true or false if it is running.
Get-Service -ComputerName $ComputerName -Name RemoteRegistry -ErrorAction SilentlyContinue | Start-Service -ErrorAction SilentlyContinue
$RemoteRegistrySvc = Get-Service -ComputerName $ComputerName -Name RemoteRegistry -ErrorAction SilentlyContinue
If ($RemoteRegistrySvc.Status -eq 'Running') { $true }
else
{
$false
Write-Warning "The 'Remote Registry Service' is not started on '$ComputerName'"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment