I was trying to list active and disabled users in AD using powershell commands.
Get-ADUser -Filter {Enabled -eq $false} | FT samaccountname
But the list was incorrectly populated. Some of the disabled users were listed in active user list.
When I checked those users' attributes, I found that the "Enabled" attribute is blank for those users. It was neither true nor false.
Please advise on how to update their attributes.
I realize this is an old question, but answering it for others who search for it.
I ran into this same issue, running the command with a domain admin account, about half the accounts were coming back with both the userAccountControl and Enabled coming back as blank, but using ADUC, I could view the userAccountControl on the attributes tab.
I can't explain the reasoning, but running powershell as administrator resolved the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With