I'm trying to use below script to get all active users from AD, however, I don't get any results although I know there are data with value 512.
Do you know what I have wrong here?
Get-ADUser -filter {$userAccountControl -eq "512"} -properties Name,userAccountControl -Server myserver.local | Export-CSV "E:\Folder\ADusers.csv" -NoTypeInformation -Encoding UTF8