Difference between revisions of "Venafi Scripts"
Jump to navigation
Jump to search
(Created page with "``` $services = @("VED", "VenafiESTService", "VenafiLogServer") foreach ( $service in $services ){ $hostPrefix = "MyhostPrefix" $count = 4 # $scriptBlock = "{hostname}" # $...") |
(No difference)
|
Revision as of 21:23, 18 July 2022
$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
}
}