Check host domain membership

Quick one line list all host in a cluster and display their domain membership status Get-Datacenter $global:DCChoice | Get-Cluster $global:CLUChoice | get-vmhost | Get-VMHostAuthentication | select -Property VMhost, @{N=”Domain”;E={$_.vmhost.Domain}},@{N=”DomainMembershipStatus”;E={$_.vmhost.DomainMembershipStatus}}

Loading

Configure NTP & Syslog

The below script allows you to quickly configure the NTP & Syslog settings on all hosts in a specified cluster. It will prompt you to enter an NTP server & Syslog server address before applying it to each host. Im using my usual variables:$Global:DCChoice – DC Choice$Global:CLUChoice – Cluster Choice function VP-SetNTPandSyslog { $NTPServer =

Loading

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

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