I create a script that shows me a list of users starting with letter A.
Now I want to export them to a CSV file with columns named full name
, username
, creation date
.
The following exports the desired column values, but doesn't have the column names (headers) that I want.
Get-ADUser -Properties whenCreated -Filter {samaccountname -like 'A*'} |
Select-Object name, SamAccountName, whenCreated |
export-csv -path c:\userexport.csv