Created
February 15, 2014 13:34
-
-
Save Nora-Ballard/9019405 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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