Quantcast
Channel: Directory Services forum
Viewing all articles
Browse latest Browse all 31638

Erroneous Results from Get-ADUser

$
0
0
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:\users\me\desktop\wtf.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?

Viewing all articles
Browse latest Browse all 31638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>