$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