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

Export-Csv

$
0
0

$VPNUsers=Import-Csv "C:\Omar\Support_Tools\My_Scripts\My_Scripts\test.csv"
$PrimaryDC = 'AD-PDC002.gotransit.local'
$DomainName = 'gotransit'
Clear-Host
Connect-QADService -service $PrimaryDC

Function RetrieveVPNUserBusiness
{
param(
[string] $_UserName
)
Get-ADUser -Identity $_UserName -Properties Office | Export-Csv "c:\Omar\temp.csv"
}

FOREACH ($User in $VPNUsers) {
RetrieveVPNUserBusiness $User.UserName
}

The export-csv is not appending records to temp.csv (file is blank).  Is there something I'm missing?

Thanks,

Omar


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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