Skip to content

Slaffcheff's place

System administration / DevOps / Life

  • About

Tag: computers

[Quicks] PowerShell How-To find all disabled users in Active Directory

Posted on September 23, 2015 - September 25, 2015 by Rosen Slavchev

Hello folks!

I found something extremely useful while I was doing a research for another topic. Back in the days I tried couple of times to review all AD users, including deleted. I had a lot of headaches regarding this task. Now I want to share with you couple of PowerShell commands.

Get-ADUser -Filter {Enabled -eq $false} | FT samAccountName

With this command you will find all disabled users inside your AD.


Get-ADUser -Filter {Enabled -eq $false} | FT samAccountName, GivenName, Surname

This is the same as the command above but with extra parameters (GivenName, Surname). So this will output the samAccountName, first name, and last name of the disabled users.


Get-ADUser -Filter {Enabled -eq $false} 

If you want no formatting whatsoever and have AD spit a bunch of information back at you, try running just the Get-ADUser part with the filter applied.


Search-ADAccount -AccountDisabled

This can be used to find out the disabled users AND computers.

Posted in Quicks, Windows ServerTagged active, computers, directory, disabled, output, powershell, quicks, script, server, users, windows

Recent Posts

  • Segmentation fault on openSUSE Leap 15.0
  • Подпишете петицията ПРОТИВ чл. 13.
  • Free image stock and graphical resources
  • Българският mirror на openSUSE
  • openSUSE в България с 2 събитие за този месец!

Archives

  • October 2019
  • November 2018
  • June 2018
  • April 2018
  • March 2018
  • January 2018
  • October 2017
  • August 2017
  • July 2017
  • July 2016
  • September 2015
  • August 2015
  • March 2015
  • February 2015

Categories

  • Automation
  • Cyber security
  • Hacking
  • Linux
  • MySQL
  • openSUSE
  • Phrack
  • Quicks
  • Scripting
  • Uncategorized
  • Up to date
  • Web Freedom
  • Windows Server
Proudly powered by WordPress | Theme: micro, developed by DevriX.