Files
Sandbox/VMware-ScratchLocations.ps1
T
Zack Meier 03dba08135 sync
2026-04-15 15:42:41 -05:00

28 lines
914 B
PowerShell

$AllHosts = Get-Datacenter Primary*, Secondary* | Get-Cluster | where-object {$_.Name -notlike "AVAYA*" -and $_.Name -notlike "TEL*"} | Sort-object Name | Get-VMHost
$result = @()
ForEach ($VMHost in $AllHosts) {
$Configured = $null
$Current = $null
$Configured = ($VMHost | Get-AdvancedSetting ScratchConfig.ConfiguredScratchLocation).Value;
$Current = ($VMHost | Get-AdvancedSetting ScratchConfig.CurrentScratchLocation).Value;
$obj = [PSCustomObject]@{
Name = $VMHost.Name;
FS92 = If ($Configured -eq $Current) { $true }Else { $false };
Configured = $Configured
Current = $Current
}
$result += $obj
}
<#
$HostsToReboot = $result | where-object FS92 -eq $False
ForEach($VMHost in $HostsToReboot){
$VMHost | Set-VMHost -State "Maintenance"
#disable alarms
#restart host
#updateprofile
#remediateprofile
}
#>