none
Add text in csv RRS feed

  • Question

  • Hi guys!

    I created a script that returns a list of users created today.
    Now I'm trying to modify it to add the text "99999999LAST RECORD" in the last line of the csv file.
    Does anyone have a suggestion how to do this?

    $When = ((Get-Date).AddDays(-0)).Date
    Get-ADUser -Filter {whenCreated -ge $When} -Properties * | Select-Object Surname,GivenName,DisplayName,PostalCode,Country,StreetAddress,State,Office,OfficePhone,EmailAddress,Title,Department,City,SamAccountName,UserPrincipalName | Export-Csv .\newusers_maximo.csv -NoTypeInformation -Encoding unicode -Force

    Thanks!


    David Soares MCTS:MBS - MCTS - MCITP

    Friday, May 23, 2014 1:26 PM

Answers

  •  

    "99999999LASTRECORD" | Out-File  .\newusers_maximo.csv -Append


    ¯\_(ツ)_/¯


    • Edited by jrv Friday, May 23, 2014 1:41 PM
    • Marked as answer by David S. Araujo Friday, May 23, 2014 2:49 PM
    Friday, May 23, 2014 1:40 PM

All replies