Link to home
Start Free TrialLog in
Avatar of MilesLogan
MilesLoganFlag for United States of America

asked on

catch samaccountanme on results file .

Hi EE

Can someone help me turn this into a script that will catch any accounts not in the users.txt file?
so the output file also includes the SamAccountName that it did not locate in AD  with an N/A result instead of just skipping it.

gc Users.txt | Get-ADUser -Properties SamAccountName,mail | Select SamAccountName,mail | Export-Csv UserMail.txt -nti
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MilesLogan

ASKER

your awesome Subsun thanks man !!