DISABLE USERS AND MAKE SURE THEY CANT GET IN.
in the below example we will disable Daffy Duck "DDuck" and than clear all the offline files so the user cannot login using cached Credential.
Disable-ADAccount -Identity "DDuck"
$credential = Get-Credential -Credential DOMAIN\adminacctEnter-PSSession -ComputerName ComputerX -Credential $credentialSet-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name CachedLogonsCount -Value 0
in the below example we will disable Daffy Duck "DDuck" and than clear all the offline files so the user cannot login using cached Credential.
Disable-ADAccount -Identity "DDuck"
$credential = Get-Credential -Credential DOMAIN\adminacctEnter-PSSession -ComputerName ComputerX -Credential $credentialSet-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name CachedLogonsCount -Value 0