Hi,
Please check to see if this works.
Get-ADUser -Filter * -Properties mail,title,department,l,Manager,mobile,telephoneNumber |
Select-Object Name,mail,title,DistinguishedName,department,@{name='Location';expression={$_.l}},mobile,telephoneNumber,
@{name='ManagerName';expression={(Get-ADUser -Identity $_.manager | Select-Object -ExpandProperty name)}},
@{name='ManagerEmailAddress';expression={(Get-ADUser -Identity $_.manager -Properties emailaddress | Select-Object -ExpandProperty emailaddress)}}|
Export-Csv adusersactive.csv
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.