Powershell

Nagaraj Chachadi 1 Reputation point
2020-12-24T08:10:50.167+00:00

I am able to read the content and how can export details in CSV using PowerShell

I am reading LDIFs and I need to export details like DN and other

could anyone please help me with this

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,627 questions
{count} votes

2 answers

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 14,986 Reputation points MVP
    2020-12-24T11:44:52.46+00:00

    @Nagaraj Chachadi

    Using powershell you can export content.

    refer below url's
    https://www.poftut.com/powershell-export-csv-command-tutorial-with-examples/

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7.1

    ----------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  2. Purna Rao 26 Reputation points
    2021-11-11T18:03:47.233+00:00

    @Nagaraj Chachadi - You can create PowerShell object with required properties and export that to CSV file like below example

    $Inventory=@()  
      
    $Object=New-Object -TypeName Object   
      
    $Object | Add-Member -NotePropertyName VMName -NotePropertyValue $vm.Name  
    $Object | Add-Member -NotePropertyName RG -NotePropertyValue $vm.ResourceGroupName  
    $Object | Add-Member -NotePropertyName Subscription -NotePropertyValue $subscriptionName  
      
    $Inventory+=$Object  
      
    $Inventory | Export-CSV -Path C:\Windows\Temp\VMInventory.csv  
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.