40 lines
765 B
PowerShell
Executable File
40 lines
765 B
PowerShell
Executable File
#!/usr/bin/env pwsh
|
||
. /opt/idssys/powerwall/conf/settings.ps1
|
||
|
||
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
||
|
||
Get-VM | Where {
|
||
$_.Name -like '*MySQL-Node2*' `
|
||
-or $_.Name -like '*Webserver-Node2*' `
|
||
-or $_.Name -like '*LB-Node2*' `
|
||
-or $_.Name -like '*UniFi-Camera-Proxy*' `
|
||
-or $_.Name -like '*Internet Monitor*' `
|
||
-or $_.Name -like '*OMSA*' `
|
||
-or $_.Name -like '*RustDesk Server*' `
|
||
-or $_.Name -like '*Fileserver*' `
|
||
-or $_.Name -like '*UrBackup*' `
|
||
-or $_.Name -like '*MySQL-Manager*' `
|
||
} | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*Offsite-Backups*'} | Shutdown-VMGuest -Confirm:$false
|
||
|
||
Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|