Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, July 15, 2015 6:45 AM
For the correct importation into a SQL table I need the date portion of the datetime to be in the yyyy/MM/dd format instead of dd/MM/yyyy for the Created property
Get-ADUser - filter * Created, Department | Select-Object Name, Created, Department ! Export-CSV c:\temp\a.txt
Can this be done for the one liner above?
All replies (1)
Wednesday, July 15, 2015 7:01 AM âś…Answered | 1 vote
Get-ADUser -Filter * -Properties Created, Department | Select-Object Name, @{Name='Created';Expression={$_.Created.ToString("yyyy\/MM\/dd HH:mm:ss")}}, Department | Export-CSV c:\temp\a.txt -NoTypeInformation
This article is useful in case you need to adjust the format: