Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User attribute "Enabled" is blank for some disabled users in Active Directory

Tags:

powershell

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.

like image 203
kpsaravan Avatar asked Dec 11 '25 06:12

kpsaravan


1 Answers

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.

like image 177
Bryan Avatar answered Dec 14 '25 07:12

Bryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!