PowerCLI: Find Orphaned Virtual Machines Location


Very useful PowerCLI script – find the orphaned virtual machines in the VMware cluster. With ‘-delete’ option it will find then delete the orphaned virtual machines. #requires -version 2 function Remove-OrphanedData{<#.SYNOPSIS   Remove orphaned folders and VMDK files.DESCRIPTION   The function searches orphaned folders and VMDK files   on one or more datastores and reports its findings.   Optionally … Continue reading PowerCLI: Find Orphaned Virtual Machines Location

vSphere 5.0 Security Hardening Recommended VM Settings Configure Script


1) Create 3 text files, one for each security profile: profile3_Low.txt RemoteDisplay.maxConnections,2 profile2_Med.txt RemoteDisplay.maxConnections,1floppyX.present,FALSEserialX.present,FALSEparallelX.present,FALSEusb.present,FALSEideX:Y.present,FALSEisolation.tools.unity.push.update.disable,TRUEisolation.tools.ghi.launchmenu.change,TRUEisolation.tools.memSchedFakeSampleStats.disable,TRUEisolation.tools.getCreds.disable,TRUEisolation.tools.autoInstall.disable,TRUEtools.guestlib.enableHostInfo,FALSE profile1_High.txt RemoteDisplay.maxConnections,1floppyX.present,FALSEserialX.present,FALSEparallelX.present,FALSEusb.present,FALSEideX:Y.present,FALSEisolation.tools.unity.push.update.disable,TRUEisolation.tools.ghi.launchmenu.change,TRUEisolation.tools.memSchedFakeSampleStats.disable,TRUEisolation.tools.getCreds.disable,TRUEisolation.tools.autoInstall.disable,TRUEtools.guestlib.enableHostInfo,FALSEisolation.tools.ghi.autologon.disable,TRUEisolation.bios.bbs.disable,TRUEisolation.tools.hgfsServerSet.disable,TRUEisolation.monitor.control.disable,TRUE 2) Create the ‘vSphere_Security_Configure.ps1’ script #Uncomment if this SnapIn has not been added#Add-PSSnapIn VMware.VimAutomation.Core CLS #Specify the VM name here$VM = Get-VM "DEV-LINUX-01" #Specify the security profile file$file = Import-Csv c:\powercli\profile3_Low.txt -Header Key,Value $creds = Get-VICredentialStoreItem -file “C:\powercli\credfile.xml”Connect-viserver -Server … Continue reading vSphere 5.0 Security Hardening Recommended VM Settings Configure Script

vSphere 5.0 Security Hardening Recommended VM Settings Check Script


#Uncomment if this SnapIn has not been added#Add-PSSnapIn VMware.VimAutomation.Core CLS $a = "<style>"$a = $a + "BODY{background-color:peachpuff;}"$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:palegoldenrod}"$a = $a + "</style>" $creds = Get-VICredentialStoreItem -file “C:\powercli\credfile.xml”Connect-viserver -Server $creds.Host -User $creds.User -Password … Continue reading vSphere 5.0 Security Hardening Recommended VM Settings Check Script

PowerShell: Check VMware Tools Status


To ensure the VMware Tools is running or not out of date, we have to periodically check it. The following PowerShell script can generate a VMware Tools status report in csv format. #Uncomment if this SnapIn has not been added #Add-PSSnapIn VMware.VimAutomation.Core CLS $creds = Get-VICredentialStoreItem -file “C:\powercli\credfile.xml” Connect-viserver -Server $creds.Host -User $creds.User -Password $creds.Password … Continue reading PowerShell: Check VMware Tools Status

List Running Processes Test Failed in Cluster Validation


If the Windows 2008 cluster validation failed to list the running process on some nodes, you can try to restart the process that has high handle counts. Use the PowerShell command to list the handlecounts in order - gwmi win32_process –computer localhost | sort handlecount | select name, handlecount In my example, the the CcmExec.exe … Continue reading List Running Processes Test Failed in Cluster Validation