Orphaned Files

May been a few years old but the below post from legendary PowerCLI vExpect Luc Dekens is very much still worth checking out…. Awesome script for finding orphaned files on your datastores! During a recent audit i managed to located almost 1TB of forgotten vmdks and iso files on numerous datastores. Anyway, Check it out:

Loading

Check VUM Compliance of a cluster

This is a fairly straightforward couple of one liners that use my usual variables (i will list them below). $global:DCChoice – DC Choice $global:CLUChoice – Cluster Choice You can add or remove these variables as required #Run a VUM compliance checkGet-Datacenter $global:DCChoice | Get-Cluster $global:CLUChoice | Scan-Inventory #Check VUM Compliance resultsGet-Datacenter $global:DCChoice | Get-Cluster $global:CLUChoice

Loading

List all hosts in a cluster then pull the CDP Information

The function “VP-HostCDPInfo” will list all hosts in cluster $Global:CLUChoice from DC $Global:DCChoice, you can then select a host and list its CDP information for each NIC Get host CDP Informationfunction VP-HostCDPInfo { $hosts = Get-datacenter $Global:DCChoice | Get-Cluster $Global:CLUChoice | get-vmhost Write-Host “================ Select host ================” $i = 1 $hosts | ForEach-Object -Process {

Loading

PowerCLI Menu

For some time now I’ve wanted to put together a PowerCLI menu system, just to make running common commands a little faster. Let’s start with vCenter, unfortunately, this is the only part that hardcoded so you’re going to need to amend this to include your vCenters FQDN ###############################File Location ############################### $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path

Loading

Sorry!

Sorry everyone, its been a long time since ive posted a blog! I have been very busy unfortunately with family life and a few changes in job. The good news is that ive been playing around with alot of powershell recently and ive got a significant amount of code to share with you all! Theres

Loading

Move a host into a cluster

This function pulls a list of hosts from your vCenter that are currently in maintenance mode and moves them into your previous selected cluster. Again this uses my usual variables, specifically: VP-MoveHostCluster – Function Name $Global:DCChoice – DC Choice$Global:CLUChoice – Cluster Choice function VP-MoveHostCluster { $hosts = Get-datacenter $Global:DCChoice | get-vmhost | Where {$_.ConnectionState -eq

Loading