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}" # $...") |
|||
| Line 20: | Line 20: | ||
} | } | ||
| + | ``` | ||
| + | |||
| + | ``` | ||
| + | Get-Service | ? { $_.DisplayName -like "venafi*" } | % { Stop-Service $_ } | ||
| + | ``` | ||
| + | |||
| + | ``` | ||
| + | Expand-Archive '.\Venafi Trust Protection Platform 22.2.0.zip' -DestinationPath 22.2.0 | ||
``` | ``` | ||
Revision as of 21:24, 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
}
}
Get-Service | ? { $_.DisplayName -like "venafi*" } | % { Stop-Service $_ }
Expand-Archive '.\Venafi Trust Protection Platform 22.2.0.zip' -DestinationPath 22.2.0