You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current disable local user fails for me when I try it on an AWS machine. I swear it worked for me previously, but it is easily replaced by
# Get the current user and set excluded accounts$currentUser= [System.Security.Principal.WindowsIdentity]::GetCurrent().Name.Split('\')[1]
$excludedAccounts=@("black team") # Add any other accounts to this array if needed# Disable local accountsGet-LocalUser|ForEach-Object {
if ($_.Name-ne$currentUser-and$excludedAccounts-notcontains$_.Name) {
Disable-LocalUser-Name $_.NameWrite-Host"Disabled local account: $($_.Name)"
}
}
The text was updated successfully, but these errors were encountered:
The current disable local user fails for me when I try it on an AWS machine. I swear it worked for me previously, but it is easily replaced by
The text was updated successfully, but these errors were encountered: