#Change these three to match up to the extracted registry data and run as Admin $YourInput = "00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,00,01,00,00,00,60,ea,00,00,01,00,00,00,60,ea,00,00,01,00,00,00,60,ea,00,00" $RegPath = 'HKLM:\SYSTEM\ControlSet001\services\servicename' $AttrName = "FailureActions" $hexified = $YourInput.Split(',') | % { "0x$_"} #IF(!(Test-Path ($RegPath+'\'+$AttrName))) if (Get-ItemProperty -Path $RegPath -Name $AttrName -ErrorAction SilentlyContinue) { 'set' Set-ItemProperty -Path $RegPath -Name $AttrName -Value ([byte[]]$hexified) } else { 'new' New-ItemProperty -Path $RegPath -Name $AttrName -PropertyType Binary -Value ([byte[]]$hexified) }
Monday, May 14, 2018
PowerShell change service autorestart
This is script for set autorestart service
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment