This commit is contained in:
2023-11-01 08:45:43 -05:00
parent edc966ba32
commit 9e7235dadb
9 changed files with 18 additions and 0 deletions

View File

@@ -8,3 +8,4 @@ Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password
get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb
# get-vm | get-snapshot | where {($_.vm -notlike '*_replica')} | select vm, name, description, created, sizegb | ConvertTo-Json -Depth 1 -WarningAction:SilentlyContinue
exit 0

View File

@@ -5,3 +5,5 @@
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
Get-VMHost -Name $args[0] | set-vmhost -State Maintenance
exit 0

View File

@@ -5,3 +5,5 @@
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
Get-VM | Where {$_.Name -like '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
exit 0

View File

@@ -17,3 +17,5 @@ Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM | if ($_.PowerState
Write-Host "VM '$($vmName)' not found!"
}
}
exit 0

View File

@@ -5,3 +5,5 @@
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
Get-Datastore | Where {$_.Name -like '*iSCSI-SYS*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
exit 0

View File

@@ -17,3 +17,6 @@ Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM | if ($_.PowerState
Write-Host "VM '$($vmName)' not found!"
}
}
exit 0

View File

@@ -5,3 +5,5 @@
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
Get-Datastore | Where {$_.Name -like '*iSCSI-PRI*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false
exit 0

View File

@@ -5,3 +5,5 @@
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
Get-VM | Where {$_.PowerState -like '*On*' -and ($_.Name -like '*MySQL-Node*' -or $_.Name -like '*LAN-DNS*')} | Suspend-VM -Confirm:$false
exit 0

View File

@@ -5,3 +5,5 @@
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword | Out-Null
Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
exit 0