Advertisement
Pavix

AD User

Jul 26th, 2023
1,269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 0.20 KB | Software | 0 0
  1. $people = Import-Excel C:\Scripts\NamestoEmails.xlsx
  2. $people[2].Email
  3. ''
  4. #$people
  5. Foreach ($E in $people.Email) { Get-ADUser -Filter {Emailaddress -Like $E} | Select-Object -ExpandProperty SamAccountName}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement