Skip to content

Instantly share code, notes, and snippets.

View alanrenouf's full-sized avatar

Alan Renouf alanrenouf

View GitHub Profile
@alanrenouf
alanrenouf / NatRules.ps1
Last active December 13, 2020 21:25
Working with vCD Edge Gateway Rules in PowerCLI
Function New-DNATRule (
$EdgeGateway,
$ExternalNetwork,
$OriginalIP,
$OriginalPort,
$TranslatedIP,
$TranslatedPort,
$Protocol) {
$Edgeview = Search-Cloud -QueryType EdgeGateway -name $EdgeGateway | Get-CIView
if (!$Edgeview) {
@alanrenouf
alanrenouf / Download PowerActions Shared Scripts.ps1
Last active August 7, 2019 15:28
Download PowerActions Shared Scripts
$uri = "https://github.com/alanrenouf/PowerActions/archive/master.zip"
$file = $Env:Temp + "\master.zip"
$destination = ($Env:ProgramData + "\VMware\myNGC\Scripts\")
If (! (Test-Path $destination)) {
Write-Host "Creating new folder"
New-Item $destination -type directory | Out-Null
}
Write-Host "Downloading to $file"
# Download the file
@alanrenouf
alanrenouf / DeployVCNS_55.ps1
Created February 2, 2015 05:11
Deploy VMware vCloud Networking and Security 5.5 (vShield)
Connect-VIServer 192.168.1.200 -User [email protected] -Password VMware1!
$vShieldInstallFile = "C:\Temp\VMware-vShield-Manager-5.5.3-2175697.ova"
$vShieldName = "VCNS01"
$vShieldNetwork = "VM Network"
$vShieldIP = "192.168.1.210"
$vShieldSNM = "255.255.255.0"
$vShieldDGW = "192.168.1.1"
$vShieldDNS = "192.168.1.1"
$vShieldCluster = "Home-Cluster"
@alanrenouf
alanrenouf / SnapshotCountEmail.ps1
Created February 9, 2015 04:07
Receiving alerts on if a VM has over a given number of snapshots
$NumberOfSnapshotsToReport = 5
$EmailFrom = "[email protected]"
$EmailTo = "[email protected]" # Add multiple with "mail1", "mail2", "Mail3"
$Subject = "VMs with $NumberOfSnapshotsToReport or more snapshots"
$SMTPServer = "smtp.mymailserver.com"
Connect-VIServer 172.16.88.200 -User [email protected] -Password VMware1!
@alanrenouf
alanrenouf / InstallHostclient.ps1
Last active February 24, 2021 07:09
Download and Install ESXi Host Client on all hosts in vCenter
Connect-viserver 10.160.200.218 -user [email protected] -Password "Admin!23"
Write-Host "Downloading latest Host Client VIB" -ForegroundColor Green
$source = "http://download3.vmware.com/software/vmw-tools/esxui/esxui_signed.vib"
$Vib = "$ENV:Temp" + "\esxui_signed.vib"
Invoke-WebRequest $source -OutFile $Vib
$Vibname = $vib.split("\")[-1]
Get-VMHost | Foreach {
@alanrenouf
alanrenouf / Check VSAN HCL.ps1
Last active January 7, 2017 20:17
Check Host HBAs against the VSAN HCL automatically.
Connect-VIServer myvcenter -user Administrator -password MyPass23
Function Get-VsanHclDatabase {
<#
.NOTES
===========================================================================
Created by: Alan Renouf
Organization: VMware
Blog: http://virtu-al.net
Twitter: @alanrenouf
@alanrenouf
alanrenouf / Get-Supported-VMXVersions.ps1
Created March 10, 2016 23:12
Check Cluster VMX Supported versions
$cluster = Get-Cluster CLU1
(Get-View $cluster.ExtensionData.EnvironmentBrowser).QueryConfigOptionDescriptor()
@alanrenouf
alanrenouf / VSAN -- All Flash Automated Deployment for Stretched Cluster.ps1
Created November 15, 2016 05:45
VMware Virtual SAN -- All Flash Automated Deployment for Stretched Cluster
####################################################################################
# #
# VMware Virtual SAN -- All Flash Automated Deployment for Stretched Cluster #
# #
####################################################################################
####################################################################################
# #
# The All-in-One and Ultimate Virtual SAN Streched Cluster Config. Script #
# #
@alanrenouf
alanrenouf / Virtual SAN Deployment Script.ps1
Created November 15, 2016 06:22
The All-in-One Virtual SAN Deployment Script
###########################################################
# #
# VMware Virtual SAN -- Making Storage Great Again #
# #
###########################################################
###########################################################
# #
# The All-in-One Virtual SAN Deployment Script #
# #
# by Alan Renouf and Rawlinson #