PowerShell – To Disable accounts – Text File

$users=Get-Content C:\Temp\useraccounts.txt
ForEach ($user in $users)
{
Disable-ADAccount -Identity $user
write-host “user $($user) has been disabled”
}

Leave a Reply

Your email address will not be published. Required fields are marked *