Disable AD User


Import-ModuleActiveDirectory

Get-ADUser-LDAPFilter'(employeeID=1200547)'| Disable-ADAccount

Disable Bulk AD Users from CSV by User’s EmployeeID

Import-ModuleActiveDirectory

Import-Csv"C:\Users.csv"| ForEach-Object{

$employeeID= $_."EmployeeID"

Get-ADUser-LDAPFilter"(employeeID=$employeeID)"| Disable-ADAccount

Write-Host"User $employeeID disabled"

}

Refer : https://morgantechspace.com/2017/02/disable-ad-user-by-specific-attribute.html

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Design a site like this with WordPress.com
Get started