This file contains hidden or 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
#Script to manage snapshots - take snaps - delete snaps - revert to snaps | |
#By Peter Hynes 06-11-2018 | |
#Comment out any section you do not want to run | |
#Replace vcentername with the name of the vcenter you are working in. | |
#Replace vm1 vm2 vm3 with the name of the vms you are working with - you can add as many vms as needed here | |
#Replace snapshotname and shapshot description with an appropriate name and description | |
connect-viserver vcentername | |
$vms = ("vm1", "vm2", "vm3",) |
This file contains hidden or 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
#Script to add disk to VMs by Peter Hynes | |
#Version 1.0 | |
#Created on the 27\09\2018 | |
#Connect to the vCenter or vcenters and Run within PowerCLI | |
#You will need to create a txt file called vms.txt and place it in the same folder as this script. Put the list of VMs you are working with in this txt file. | |
$vcenter = Read-Host "Enter name of the vcenter you are working in" | |
#Connect to vcenter | |
connect-viserver $vcenter |
This file contains hidden or 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
#Script to get provisioned state for clusters in a vc by Peter Hynes | |
#Needs vSphere overcommit module located at https://blogs.vmware.com/PowerCLI/2015/01/powercli-module-check-cpu-memory-storage-overcommitment.html | |
#Script asks for a vcenter name | |
$Vcenter = read-host "please enter the name of the vcenter you will be working in" | |
#Connects to the vcenter | |
Connect-viserver $Vcenter | |
#get all clusters |
This file contains hidden or 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
#Script to get bios version by Peter Hynes | |
#Version 1.0 | |
#Created on the 11/04/2018 | |
#Connect to the vCenter or vcenters and Run within PowerCLI | |
#You will need to create a txt file called clusters.txt and place it in the same folder as this script. Put the list of clusters you want to pull info from in to this txt file. | |
$clusters = get-content .\clusters.txt | |
try { | |
get-cluster $clusters | |
This file contains hidden or 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
#Script to get bios version of esxi host VMs by Peter Hynes | |
#Version 1.0 | |
#Created on the 11/04/2018 | |
#Connect to the vCenter or vcenters and Run within PowerCLI | |
#You will need to create a txt file called clusters.txt and place it in the same folder as this script. Put the list of clusters you want to pull info from in to this txt file. | |
$clusters = get-content .\clusters.txt | |
ForEach($cluster in $clusters){ |
This file contains hidden or 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
#Python script to test connection to vcenter api and pull vm information | |
from pyVim.connect import SmartConnect, Disconnect | |
import ssl | |
username = input("Please enter your username: ") | |
password = input("Please enter your password: ") | |
s =ssl.SSLContext(ssl.PROTOCOL_TLSv1_1) | |
s.verify_mode = ssl.CERT_NONE |
This file contains hidden or 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
#Script to pull local permissions on esxi hosts | |
#Version 1.0 | |
#@Peter Hynes | |
#Created on Nov 9th 2017 | |
#You will need to create 3 txt files and populate them hosts.txt, vcs.txt and ilos.txt. Place these files in the same folder as this script. | |
#Load powercli modules | |
Get-Module -Name VMware* -ListAvailable | Import-Module | |
Add-PSSnapin vmware* |
This file contains hidden or 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
/* | |
ClothesShopCalc.java | |
@ Peter Hynes | |
28th Sept | |
*/ | |
//Scanner class - Utility package import | |
import java.util.*; | |
//class signature |
This file contains hidden or 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
#Script to Pull logs from ESXi host by Peter Hynes | |
#Version 1.0 | |
#Created on the 03\03\2017 | |
#Run within PowerCLI | |
#Script will ask for Vcenter name and hosts name | |
#vCenter you are working in | |
$vcenter = read-host "Please enter the name of the vCenter you will be working in" | |
#Host you are pulling logs from |
This file contains hidden or 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
#Script to delete VMs by Peter Hynes | |
#Version 1.10 | |
#Created on the 16\03\2017 | |
#Connect to the vCenter or vcenters and Run within PowerCLI | |
#You will need to create a txt file called vms.txt and place it in the same folder as this script. Put the list of VMs you want to delete in to this txt file. | |
#Load powercli modules | |
Get-Module -Name VMware* -ListAvailable | Import-Module | |
Add-PSSnapin vmware* |
NewerOlder