Hi, I have a script that queries the A/D for accounts that are enabled:
Get-ADUser -SearchBase 'OU=Users,OU=XXXXX,DC=XXXXX,DC=co,DC=uk' -filter {enabled -eq "True"} | Select-Object Name,SamAccountName | Sort-Object Name | Select -Property Name,SamAccountName | Out-file -file "C:\Active Directory\Active Users.txt"
Which appears to work, but on further inspection, I have found that it is listing a few odd 'disabled' accounts (verified in A/D)...I even tried {enabled -eq "False"} to try and report the disabled accounts, but it misses them???
Help much appreciated