Skip to content

Instantly share code, notes, and snippets.

View vMarkusK's full-sized avatar

Markus Kraus vMarkusK

View GitHub Profile
<#
.SYNOPSIS
Tells you how to get Awsome.
.DESCRIPTION
Tells you how to get Awsome.
.EXAMPLE
Get-Awsome
@vMarkusK
vMarkusK / Report-LUNPath-ESXCLI.ps1
Last active June 14, 2016 08:06
Reports ESXi Path-Count from all Devices via PowerCLI GET-ESXCLI -V2
# Start Load VMware Snapin (if not already loaded)
if (!(Get-PSSnapin -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
if (!(Add-PSSnapin -PassThru VMware.VimAutomation.Core)) {
# Error out if loading fails
Write-Error "ERROR: Cannot load the VMware Snapin. Is the PowerCLI installed?"
Exit
}
}
# End Load VMware Snapin (if not already loaded)
@vMarkusK
vMarkusK / vCheck-Report-LUNPath-ESXCLI.ps1
Created June 14, 2016 12:40
Checks ESXi LUNs that have to much Paths or Multiple LUN IDs
# Start of Settings
# Set the maximum number of paths per LUN
$MaxLUNPaths = 4
# End of Settings
$myHosts = $VMH | where {$_.ConnectionState -eq "Connected" -and $_.PowerState -eq "PoweredOn"}
$Report = @()
foreach ($myHost in $myHosts) {
$esxcli2 = Get-ESXCLI -VMHost $myHost -V2
@vMarkusK
vMarkusK / Set-ConsolidationFix.ps1
Last active June 15, 2016 21:25
Fix for Snapshot consolidation in VMware ESXi 5.5.x and ESXi 6.0.x
Function Set-ConsolidationFix {
[cmdletbinding()]
param (
#[parameter(Mandatory=$true)]
[parameter(Mandatory=$true,ValueFromPipeline=$true)]
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]$myVM,
[parameter(Mandatory=$true)]
[string]$Fix = "Timeout" # Timeout or Stun
@vMarkusK
vMarkusK / CheckDatastoresConnected.ps1
Last active June 23, 2016 09:44
Check All VMFS Datastores connected on all VMware ESXi Hosts
# Start Load VMware Snapin (if not already loaded)
if (!(Get-PSSnapin -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
if (!(Add-PSSnapin -PassThru VMware.VimAutomation.Core)) {
# Error out if loading fails
Write-Error "ERROR: Cannot load the VMware Snapin. Is the PowerCLI installed?"
Exit
}
}
# End Load VMware Snapin (if not already loaded)
@vMarkusK
vMarkusK / Get-vmUUIDs.ps1
Last active July 22, 2016 07:08
Reports all vSphere VM UUIDs
$myVMs = Get-VM TST* | sort Name
$MyView = @()
ForEach ($myVM in $myVMs){
$UUIDReport = [PSCustomObject] @{
Name = $myVM.name
UUID = $myVM.extensiondata.Config.UUID
InstanceUUID = $myVM.extensiondata.config.InstanceUUID
LocationID = $myVM.extensiondata.config.LocationId
MoRef = $myVM.extensiondata.Moref.Value
@vMarkusK
vMarkusK / Get-VMmaxIOPS,ps1
Last active August 10, 2016 15:26
This will Create a vSphere VM Disk IOPS Report
function Get-VMmaxIOPS {
<#
.NOTES
===========================================================================
Created by: Markus Kraus
Twitter: @vMarkus_K
Private Blog: mycloudrevolution.com
===========================================================================
Changelog:
2016.08 ver 1.0 Base Release
@vMarkusK
vMarkusK / PRTG-Veeam-CloudVMs.ps1
Last active November 3, 2016 11:13
PRTG Veeam Cloud Connect Usage Sensor
<#
.SYNOPSIS
PRTG Veeam Cloud Connect Usage Sensor
.DESCRIPTION
Advanced Sensor will Report Cloud Connect Tenant Statistics
.EXAMPLE
PRTG-Veeam-CloudVMs.ps1 -Server VeeamEM.lan.local -HTTPS:$True -Port 9398 -Authentication <dummy>
@vMarkusK
vMarkusK / PRTG-ScheduledTask.ps1
Last active September 14, 2016 10:48
PRTG Advanced Scheduled Task Sensor
<#
.SYNOPSIS
PRTG Advanced Scheduled Task Sensor
.DESCRIPTION
This Advanced Sensor will report Task Statistics.
.EXAMPLE
PRTG-ScheduledTask.ps1 -ComputerName myComputer.lan.local -TaskName "myTaskName"
@vMarkusK
vMarkusK / Windows2012-SoftResetTSC.ps1
Created September 19, 2016 14:57
Fix: Rebooting Windows 8 or 2012 Server or later virtual machines fail at the Microsoft Windows boot splash screen.
<#
.SYNOPSIS
Add monitor_control.enable_softResetClearTSC = TRUE
.DESCRIPTION
Add monitor_control.enable_softResetClearTSC = TRUE to the virtual machines advanced configuration
.Example
./Windows2012-SoftResetTSC.ps1