Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Get-Aduser Error Handling

$
0
0

Hi Guys,

I have a text file which contains email address. Now some of them are not valid users for my domain. When I am using 

Get-ADUser -Filter {EmailAddress -eq "Emailaddress"} |select SamAccountName, its giving me the result of valid address but for invalid mails, nothing comes in. Any suggestion what can be done to generate the error of invalid mail id's. 

Please note, I have used Get-Content and foreach loop, no issue with that.

Thanks in Advance. 


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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