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 |
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
<# | |
.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
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
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 | |
$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 vcenter02 -Credential $cred | |
$deletevmlist=Get-Content C:\temp\delete.txt | |
foreach($deletevm in $deletevmlist) | |
{ | |
write-output ("$deletevm is deleting...") | |
get-cluster cluster02|get-vm $deletevm |Remove-VM -DeletePermanently -Confirm:$false -RunAsync| out-null | |
Start-Sleep 10 | |
} |
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 | |
This script will check SCCM client status,version & sitecode. | |
If the site code is not cloudwiki1 it will assign/change to cloudwiki1 | |
#> | |
Start-Transcript c:\temp\versionlog.txt | |
$r="Running" |
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
$r="Running" | |
$servers=get-content "C:\temp\SCCM\servers.txt" | |
$Name = "SCCM_Serv.html" | |
$report = "C:\temp\SCCM\" + $Name | |
$header = " | |
<html> | |
<head> |
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
#This script can be used to to clear un used space of C:\ in windows servers | |
#once the task is completed it will send a mail to the added in $msg.To.Add | |
#please update your own smtp server address | |
#enter the servers suppose to release un-used space in 123.txt file (ex--c:\temp\123.txt) | |
#Create a folder named Cleanupreports in C:\temp | |
#Script assumes delprof is already installd in all the servers | |
$Path = "C:\temp\Cleanupreports\" |
OlderNewer