Venafi Scripts

From UVOO Tech Wiki
Revision as of 21:23, 18 July 2022 by Busk (talk | contribs) (Created page with "``` $services = @("VED", "VenafiESTService", "VenafiLogServer") foreach ( $service in $services ){ $hostPrefix = "MyhostPrefix" $count = 4 # $scriptBlock = "{hostname}" # $...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
}

}