I have been trying to get the Enabled Status of all users in our AD tree. I have tried several different things without much success.
Here is what I've tried so far:
Get-ADUser -Filter * | select Name, Surname, GivenName, Enabled | Out-GridView
This will get me a list of all users, but only a few have the Enabled column filled in. As you can see below there are only 2 users in this example that have a value. All of these users should have a value and only the user Camera should be false.
Then I've tried this:
Get-ADUser -Filter 'Name -like "*Michael*"' | select Name, Surname, GivenName, Enabled | Out-GridView
This gave me a list of all the "Michael"'s in the AD, but still did not provide me with the Enabled status of all of them, see below:
I've tried pulling just one person also, I still don't get the Enabled status, unless it was a person who it already showed up for.
I am using Windows Server 2012 Standard. Powershell version from
Major Minor Build Revision ----- ----- ----- -------- 3 0 -1 -1
I can open the Active Directory Users and Computer and see the users that I'm trying to get the Enabled status for. I can right-click each one and see whether they are enabled or not, but there are hundreds of users and this would take much to long.
Is there an easier way that I'm not doing? Or is my command in Powershell wrong?
I have now also tried this:
Get-ADUser -Properties Enabled, LastLogonDate -Filter 'enabled -eq $true' | select Name Surname, GivenName, Enabled, LastLogonDate | Out-GridView
I have found that this gives me most of the same users, but still only a few have the
Enabled column filled. And I have discovered that this pulls users that are not enabled, I'm guessing that is because the
Enabled column is blank.