Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Append Text to CSV

$
0
0

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


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>