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 | |
Creates Distributed Port Groups from input file, skipping correctly configured existing port groups. Optionally, reconfigures existing Port Groups to match the specifications in the file. | |
.EXAMPLE | |
Get-VDSPGs.ps1 -vdSwitch SAC-Production -ConfigFile E:\Temp\DVS.csv -fixErrors | |
This command will read the input file at E:\Temp\DVS.csv for all entries pertaining to the SAC-Production Distribtued vSwitch and will add any new Port Groups and will reconfigure any existing Port Groups that have had configuration drift. | |
.NOTES | |
Input File: Needs these columns: Name, VLAN, PortBinding, DVS | |
Author: Jason Coleman |
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
# Powershell script to discover VMDK files that are not referenced in any VM's VMX file. | |
# Warning - I've heard reports that this doesn't work on some versions of ESXi and have no had time to troubleshoot/test it. | |
# Also detects VMDKs from machines that need snapshot consolidation (from differentials that exist but are not part of the tree). | |
# Author: HJA van Bokhoven | |
# Modifications: LucD | |
function LoadSnapin{ | |
param($PSSnapinName) | |
if (!(Get-PSSnapin | where {$_.Name -eq $PSSnapinName})){ | |
Add-pssnapin -name $PSSnapinName |
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
#Description: Changes ESXi Host root passwords for all specified ESXi Servers | |
#Author: Jason Coleman | |
#Website: http://virtuallyjason.blogspot.com/ | |
#Reference: http://virtuallyjason.blogspot.com/2015/10/batch-changing-esxi-root-passwords.html | |
#Usage: change-passwords.ps1 -oldPass <old root password> -passString <new root password> | |
param | |
( | |
$passString = "StrongPassword" + '<_<">_>', | |
$oldPass = "WeakPassword", |
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
Name | VLAN | PortBinding | DVS | |
---|---|---|---|---|
VL1-NetMgmt | 1 | Ephemeral | SAC-Production | |
VL2-Servers | 2 | Ephemeral | Production | |
VL3-VDI | 3 | Ephemeral | SF-Production |
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 | |
Takes an array of file names (output from something like RV Tools) that are zombie VMDK files. Outputs VMKFSTOOLS commands to rename the files and to delete the files | |
.EXAMPLE | |
ThisIsmyBoomStick.ps1 -zombies E:\Temp\RV-Out.csv -outRename E:\Temp\RenameCommands.txt -outDelete E:\Temp\DeleteCommands.txt | |
This command will read the E:\Temp\RV-Out.csv input file, which can be the raw output from the RVTools vHealth tab, parse through it for Zombie VMDK lines, and generate rename and delete VMKFSTOOLS commands for those identified files. | |
.NOTES | |
The input file should be the output from the vHealth tab of the RVTools application. It expects a CSV with 2 columns: Name and Message. The message column must include the word Zombie and the Name column must be in the "[LUN] Folder/File.vmdk" syntax. | |
#> |
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
# Renames local datastores on ESXi hosts to use the hostname plus a specified suffix. | |
# Usage: Rename-Local.ps1 -cluster <Cluster name> -suffix <Datastore Suffix> | |
# Website: http://virtuallyjason.blogspot.com/ | |
# Reference: http://virtuallyjason.blogspot.com/2015/12/renaming-esxi-host-local-datastores-by.html | |
# Original script by VMNick0 at http://www.pcli.me/?p=25 | |
[cmdletbinding(SupportsShouldProcess=$True)] | |
param( | |
$cluster = "sac-cluster", | |
$suffix = "-local" | |
) |
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
set-location E:\Scripts | |
$Shell = $Host.UI.RawUI | |
$size = $Shell.WindowSize | |
$size.width=80 | |
$size.height=25 | |
$Shell.WindowSize = $size | |
$size = $Shell.BufferSize | |
$size.width=80 | |
$size.height=5000 | |
$Shell.BufferSize = $size |
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 a list of all Aliases from the specified Brocade Switch, then output a list of which of those Aliases correspond to currently active WWNs | |
#The -ReportAll switch will spit out a list of ALL discovered Aliases instead of just the active ones | |
param | |
( | |
$user = "admin", | |
$switch, | |
$password, | |
[switch]$reportAll | |
) | |
if ($plinkAliases = plink $user@$switch -pw $password 'alishow'){ |
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
$items = 1..3 | |
$i = 1 | |
foreach ($item in $items){ | |
write-progress -id 1 -activity "Parent Progress Bar" -status "Iteration $item" -percentComplete ($i++ / $items.count * 100) | |
$j = 1 | |
foreach ($child in $items){ | |
write-progress -parentId 1 -activity "Child Progress Bar" -status "Iteration $item`.$child" -percentComplete ($j++ / $items.count * 100) | |
Start-sleep 1 | |
} | |
} |
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 Datastore Functions | |
.DESCRIPTION A collection of functions to manipulate datastore Mount + Attach status | |
.EXAMPLE Get-Datastore | Get-DatastoreMountInfo | Sort Datastore, VMHost | FT -AutoSize | |
.EXAMPLE Get-Datastore IX2ISCSI01 | Unmount-Datastore | |
.EXAMPLE Get-Datastore IX2ISCSI01 | Get-DatastoreMountInfo | Sort Datastore, VMHost | FT -AutoSize | |
.EXAMPLE Get-Datastore IX2iSCSI01 | Mount-Datastore | |
.EXAMPLE Get-Datastore IX2iSCSI01 | Get-DatastoreMountInfo | Sort Datastore, VMHost | FT -AutoSize | |
.EXAMPLE Get-Datastore IX2iSCSI01 | Detach-Datastore | |
.EXAMPLE Get-Datastore IX2iSCSI01 | Get-DatastoreMountInfo | Sort Datastore, VMHost | FT -AutoSize |