Created
March 15, 2019 04:28
-
-
Save matthewbodaly/56e62919f1b1829db686b1050f35b793 to your computer and use it in GitHub Desktop.
Thanks StackOverflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# your funeral | |
# This isn't original to me | |
# https://stackoverflow.com/questions/47035953/how-to-get-samaccountname-from-an-e-mail-using-powershell | |
Get-Content ".\in.txt" | | |
ForEach-Object { Get-ADUser -LDAPFilter "(mail=$_)" } | | |
Select-Object -ExpandProperty sAMAccountName | | |
Out-File ".\out.txt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment