Get-ADUser -filter * -SearchBase 'OU=aaaaaa,OU=aaaa,OU=aaaaa,DC=test,DC=cn' -Properties *|Get-ADUser -Properties Mail | Select-Object Name,Mail |export-csv C:mailuser.csv –NoTypeInformation -encoding "utf8"
Get-ADUser -filter * -SearchBase 'OU=aaaaaa,OU=aaaa,OU=aaaaa,DC=test,DC=cn' -Properties *|Get-ADUser -Properties Mail | Select-Object Name,Mail |export-csv C:mailuser.csv –NoTypeInformation -encoding "utf8"