Erroneous Results from Get-ADUser

The below AD query gives me thousands of results, including four named: 7-Jan, 7-Mar, 1-Apr, 8-May

Get-ADUser -Filter * -SearchBase "OU=Departments,DC=dom,DC=for" | Select-Object samaccountname | export-csv -Path c:usersmedesktopwtf.csv -NoTypeInformation 

However, when I use Powershell to ask AD to show me users with the samaccountname of any from the above list I get nothing:

Get-ADUser -filter * -SearchBase "OU=Departments,DC=dom,DC=for" | Select-Object samaccountname | Where-Object {$_.samaccountname -eq "7-Jan"} 

Does anyone have any idea or explanation for this?

submitted by /u/thingandstuff
[link] [comments]

Leave a Reply