Venafi Scripts
Jump to navigation
Jump to search
$services = @("VED", "VenafiESTService", "VenafiLogServer")
foreach ( $service in $services ){
$hostPrefix = "MyhostPrefix"
$count = 4
# $scriptBlock = "{hostname}"
# $cmd = "hostname; pwd"
$cmd = "sc.exe failure `"$service`" reset=3600 actions= restart/30000"
for ($i = 1; $i -lt ($count+1); $i++){
if($i -lt 10){
$hostSuffix = "0$i"
} else {
$hostSuffix = "$i"
}
$h = "${hostPrefix}$hostSuffix"
Invoke-Command -ScriptBlock {powershell -c "$Using:cmd"} $h
}
}