Need help exporting to CSV

Welcome Forums General PowerShell Q&A Need help exporting to CSV

Viewing 1 reply thread
  • Author
    • #265595
      Topics: 2
      Replies: 1
      Points: 13
      Rank: Member

      I have this bit of script and I am trying to get the results output to a CSV.

      $time = (Get-Date).Adddays(-5)

      $vm = (Get-ADComputer -Filter { OperatingSystem -Like ‘*Windows Server*’-and LastLogonTimeStamp -gt $time } | Where-Object {$_.distinguishedname -notmatch “OU=Domain Controllers”}  | Select-Object -ExpandProperty Name)

      Invoke-Command -ComputerName $vm -ScriptBlock {
      $reg = REG QUERY HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\ /v EnableLUA
      $hostname = hostname
      write-host $hostname $reg

      Any ideas?

    • #265622
      Topics: 9
      Replies: 676
      Points: 2,674
      Helping Hand
      Rank: Community Hero

      Any ideas on outputting results to CSV? What is the issue you’re having? I don’t see any attempts to export to csv so not sure what you are asking. Check out the help topics for ideas.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.