How to disable a computer account in Active Directory with PowerShell?
Disabling a computer account in Active Directory, means that whoever login to the computer is not able to communicate with Active Directory.
It's quick and easy to disable a computer account and denied access to AD environment.
Login as an Administrator account to the AD server.
Launch PowerShell.
Type this command:
Set-ADComputer -Identity "ComputerName" -Enabled $false
Replace ComputerName with the correct computer name account.
That's it the computer account is disabled, but be sure you have a good reason to do it.
If you just want to have fun, and need to enable it at a later time just change the properties to true.
Set-ADComputer -Identity "ComputerName" -Enabled $true
To check the status of the computer account type this command below:
Get-ADComputer -Filter 'Name -like "ComputerName*"' | FT Name, Enabled
It will display the Computer name and the status whether its disabled or enabled.
Cheers!! Have fun with PowerShell, click on the PowerShell label below for more PowerShell code snippets on this blog.
Linux Android App cheat sheet:
https://play.google.com/store/apps/details?id=com.LinuxMobileKit
This comment has been removed by the author.
ReplyDeletenice software..thanks for sharing...
DeleteThis comment has been removed by the author.
ReplyDeleteYou can send an article i'll post it here.. if you want to...
Delete