I'm trying to write the following script and ANY help would be greatly appreciated:
1) Export the the employeeID, mail properties to a CSV file
2) Reimport that CSV file and add the $prefix before the employeeID
3) Export modified CSV file
I want the CSV to look like so...
NTLM://DOMAIN/employeeID, employee@email.com
Import-Module ActiveDirectory
$ou = "OU=BLAH, DC=test,DC=com"
$prefix = "NTLM://DOMAIN/
Get-ADUser -Filter * -Property employeeID,mail -SearchBase $ou | Where-Object {$_.mail -ne $null} | Select employeeID,mail | export-csv .\blah.csv
Import-Csv .\blah.csv | Foreach { $_.$prefix } | export-csv tada1.csv -NoTypeInformation