Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

powershell get samaccountname from first and last name

$usernames = Import-Csv "filepath.csv" -Header GivenName,Surname -Delimiter "," | ForEach {
  Get-ADUser -Filter {GivenName -like $_.GivenName -and Surname -like $_.Surname} | Select-Object -ExpandProperty sAMaccountName 
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #powershell #samaccountname
ADD COMMENT
Topic
Name
3+3 =