This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Module -ListAvailable *vm*|Import-Module | |
$cred=Get-Credential | |
Connect-VIServer vcenter01 -Credential $cred | |
$deletevmlist=Get-Content C:\temp\stopvms.txt | |
foreach($vm in $deletevmlist) | |
{ | |
$vmstate=get-vm $vm | |
if($vmstate.PowerState -eq "PoweredOn") | |
{ | |
write-output ("$vm is powered-on hence stopping it") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Module -ListAvailable *vm*|Import-Module | |
$cred=Get-Credential | |
connect-viserver vcenter01 -Credential $cred | |
$vmlist=Get-Content C:\temp\rebootvms.txt | |
foreach ($vm in $vmlist) | |
{ | |
get-cluster cluster02|get-vm $vm | Restart-VM -Confirm:$false | |
start-Sleep 2 | |
Write-Output "$vm has been rebooted" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Module -ListAvailable *vm*|Import-Module | |
$cred=Get-Credential | |
Connect-VIServer vcenter01 -Credential $cred | |
$vms=Get-Content C:\temp\vmcheck.txt | |
foreach($vm in $vms) | |
{ | |
$exsists=Get-Cluster cluster02|get-vm $vm -ErrorAction SilentlyContinue | |
if($exsists){ | |
Write-Output "$vm exist" } | |
else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Author | |
Sandeep S R | |
.Synopsis | |
A simple script to Change the network adapter of a VM | |
.Note | |
- Copy the vm names into a text file named "servers" and place it into C:\temp before executing the script | |
- in $cl , provide the cluster name Ex : "cluster-25" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
. Synopsis | |
VSAN Health check. | |
Health checks get the SSD & NonSsd's failed information and Uuid of failed disk | |
When a Disk failed it will be shown as NonSSD disk error | |
#> | |
Get-Module -ListAvailable VM* | Import-Module | |
$cred=Get-Credential | |
Connect-VIServer vcenter -Credential $cred -ErrorAction stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Enabling SSH & Execute esxcli commands | |
.Description | |
By using this script we can check the SSH service status and if ssh service is stopped we will start it | |
As well how to execute the esxcli commands | |
#> | |
Get-Module -ListAvailable *vm*|Import-Module |
NewerOlder