Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

For Each Loop Collection and CSV Export

$
0
0

Need Help i have an account creation script and i am auditing/validating the account creation at the end. The script creates multip users i have the following so far.

foreach ($user in $Users)
{
Get-QADUser -Identity $user.saMaccountname -IncludeAllProperties |
Select displayname,samaccountname,employeeid,email,creationdate,accountexpires,homedirectory |
Export-Csv C:\NewHire\LOGS\consultantcreation-$date.csv -NoTypeInformation

}

I need to do this for each user but the out put needs to all go in to one csv file. Any Ideas right now it will generate csv file for each user.


Viewing all articles
Browse latest Browse all 6937

Trending Articles