Call command-line processes and write result to CSV file

  • Thread starter Thread starter deskcheck1
  • Start date Start date
D

deskcheck1

Guest
Hi,

I have two lines of command line script that I want to call from my Windows Form app. How do I call these scripts from my app and then write the result to a CSV file? The command line scripts are:

Import-Module ActiveDirectory
Get-ADComputer -Filter {enabled -eq $true} -properties *|select Name, DNSHostName, OperatingSystem, LastLogonDate

The above generates a list of computers connected to our domain and the last logon date for each. I'd like to write this result to a CSV file so I can use it in my app.

Appreciate any response.


Marilyn Gambone

Continue reading...
 
Back
Top