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 checks if the iovDisableIR setting is set to FALSE. | |
.DESCRIPTION | |
The script checks the current setting of the Intel IOMMU interrupt remapper (iovDisableIR). | |
The script needs a single parameter: | |
- vSphere Cluster |
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 checks if the iovDisableIR setting is set to FALSE. | |
.DESCRIPTION | |
The script checks the current setting of the Intel IOMMU interrupt remapper (iovDisableIR). | |
The script needs a single parameter: | |
- vSphere Cluster |
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 retrieves a console screenshot of one or more virtual machines. | |
.DESCRIPTION | |
The script needs four parameters: | |
- the name of the VM (name from the inventory) | |
- the hostname of a vCenter or ESXi host | |
- username, and |
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 | |
No parameters needed. Just execute the script. | |
.DESCRIPTION | |
The script deploys a couple of VMs to Azure. | |
History | |
v0.1: Under development | |
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
from pyVim.connect import SmartConnect, Disconnect | |
import ssl | |
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) | |
s.verify_mode = ssl.CERT_NONE | |
try: | |
c = SmartConnect(host='vcenter.lab.local', user='root', pwd='Passw0rd') | |
print('Valid certificate\n') | |
except: |
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
import ssl | |
from pyVim.connect import SmartConnect | |
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) | |
s.verify_mode = ssl.CERT_NONE | |
c = SmartConnect(host="192.168.20.1", user="root", pwd='Passw0rd', sslContext=s) | |
h = c.content.sessionManager.currentSession.key | |
print (h) |
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
### | |
# VMware PowerCLI | |
### | |
# Create a new entry in the credential store | |
New-VICredentialStoreItem -Host vcenter.domain.tld -User Username -Password Passw0rd | |
# Connect to vCenter server (credential store item exist for this vCenter server) |
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
Const wbemFlagReturnImmediately = &h10 | |
Const wbemFlagForwardOnly = &h20 | |
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") | |
Set colItems = objWMIService.ExecQuery("SELECT Name,DeviceID FROM Win32_NetworkAdapter WHERE NetConnectionStatus=2", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) | |
For Each objItem In colItems | |
strName = objItem.Name | |
Set colNicConfigs = objWMIService.ExecQuery _ | |
("ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='" & objItem.DeviceID & "'} WHERE AssocClass=Win32_NetworkAdapterSetting") |
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
#requires -Version 1 | |
#requires -PSSnapin VMware.VimAutomation.Core | |
function Get-CpuRatio { | |
<# | |
.SYNOPSIS | |
No parameters needed. Just execute the script. | |
.DESCRIPTION |
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 | |
No parameters needed. Just execute the script. | |
.DESCRIPTION | |
This script will shut down all VMs, the ESXi hosts that were running the VMs, the vCenter VM | |
and, at the end, the ESXi host that was running the vCener VM. | |
Please modify all necessary variables. Make sure that you read the comments! | |