I am looking to format the output of my csv, my code is below:
Get-ADUser -Filter {department -like "*"} -Properties * |Select-Object givenname, surname, department, emailaddress, office, manager |Export-Csv "c:\test.csv"
Output: John, Doe, Department, email@domain, Office, CN=John Manager,OU=user,DC=domain,DC=local
I would like to strip out the domain objects in the output of manager and just have John Manager show, how could I do this please?