
[CmdletBinding()]
param (
)
    
begin {
        
}
    
process {
    Connect-ITDvCenter -Credential $Secret:ndgov_svcitdvmvcauto
    
    $VMHosts = Get-Datacenter -Name "Grand Forks Vantis" | Get-VMHost
    
    ForEach ($VMHost in $VMHosts) {
        Write-Verbose -Message ("Start: " + $VMHost.Name) -Verbose
    
        $VMHostStatus = Get-ITDVMwareVMHostStatus -Name $VMHost.Name
        
        # if accurate, enable lockdown
        If ($VMHostStatus.LockdownMode -eq 'lockdowndisabled') {
            Write-Verbose -Message ("Lockdown is already disabled on " + $VMHost.Name + ", no change") -Verbose
            $NoChange = $true
        }
        Else {
            Write-Verbose -Message ("Lockdown is enabled on " + $VMHost.Name + ", disabling now") -Verbose
            Disable-ITDVMwareVMHostFeature -Name $VMHost.Name -LockdownMode
            
        } 
        Start-Sleep -Seconds 5
        
        # confirm lockdown is enabled
        $VMHostStatusCheck = Get-ITDVMwareVMHostStatus -Name $VMHost.Name
    }

    Disconnect-ITDvCenter
}
    
end {
        
}
