PowerTip: Create Custom Names for CSV File

PowerTip: Create Custom Names for CSV File

  • Comments 5
  • Likes

Summary: Use Windows PowerShell to create custom column headings.

Hey, Scripting Guy! Question How can I use Windows PowerShell to generate custom heading for a CSV file when I import it?

Hey, Scripting Guy! Answer Specify the –Header parameter as an array of names in the order of the fields, for example:

Import-CSV c:\fso\myfile.csv –delimiter “:” –header ‘FName’, ‘LName’, ‘Street’, ‘City’, ‘State’, ‘Zip’

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Could you please tell me how to fetch names who created an account in AD. I tired to enable the Auditing policy but seems didn't work also run the REPADMIN /SHOWOBJMETA but cannot find who created the particular account in AD. Please provide some command or some other method to find the creator of AD account.
    REPADMIN /SHOWOBJMETA
    2013-01-02 08:37:12 1 objectClass
    2013-01-02 08:37:12 1 cn
    2013-01-02 08:37:12 1 sn
    2013-01-02 08:37:12 1 c
    2013-01-30 21:06:22 3 l
    2013-01-02 08:37:12 1 st
    2013-01-02 13:35:35 1 title
    2013-01-02 08:37:12 1 postalCode
    2013-01-02 08:37:12 1 postOfficeBox
    2013-01-02 08:50:10 1 physicalDeliveryOffice
    2013-01-02 08:50:10 1 telephoneNumber
    2013-01-02 08:50:19 1 facsimileTelephoneNumb
    2013-01-02 08:37:12 1 givenName
    2013-01-02 08:37:12 1 instanceType
    2013-01-02 08:37:12 1 whenCreated
    2013-01-02 08:37:12 1 displayName
    2013-01-02 08:37:12 1 co
    2013-01-30 21:06:22 4 department
    2013-01-30 21:06:22 3 company
    2013-01-02 09:00:54 1 proxyAddresses
    2013-01-02 08:50:10 1 streetAddress
    2013-01-02 08:37:12 1 nTSecurityDescriptor
    2013-01-02 08:37:12 1 employeeType
    2013-01-02 08:37:12 1 name
    2013-01-02 08:37:13 4 userAccountControl
    2013-01-02 08:37:12 1 codePage
    2013-01-02 08:37:12 1 countryCode
    2013-01-02 08:50:19 2 homeDirectory
    2013-01-02 08:37:12 1 homeDrive
    2014-08-21 14:53:42 43 dBCSPwd
    2013-08-22 15:39:20 11 scriptPath
    2013-01-02 08:37:12 1 logonHours
    2014-08-21 14:53:42 43 unicodePwd
    2014-08-21 14:53:42 43 ntPwdHistory
    2014-08-21 14:53:42 43 pwdLastSet
    2013-01-02 08:37:12 1 primaryGroupID
    2014-08-21 14:53:42 42 supplementalCredential
    2013-01-02 08:50:19 4 userParameters

    Thanks

  • thanks

  • Thanks. I am getting a lot from these short tips!

  • Hi Nyadav,

    Just to confirm that you want to track users that create accounts on AD?