I am new to powershell, but actually I need a script so I started to read myself into this stuff and found powershell.
I have a username list like:
- xyxz
- domainname\xyxz.xyxc
This script should search all the samaccountname from my userlist and give me the email adresses for every samaccountname.
Get-Content C:\Users\xxxxx\Desktop\Users.txt | forEach { Get-ADUser "I dont Know how to specify the username" | select mail | Export-Csv output.csv }
This is the script I was writing know, but I don't know how to finish it to get it work. I know it is not well done but I don't wanted to write some text here without doing something myself.