In an ActiveDirectory Export I want the mail adresses in all lowercase, I know about ToLower()
but I'm struggling putting it in the right place:
(Powershell)
Get-ADUser
-SearchBase "OU=11-something,DC=somethingelse,DC=somethingelser"
-Filter {somefilters} -Properties name,mail
|Select-Object Name,(mail).ToLower()
| Export-Csv -Path "D:\Path"
-Encoding UTF8 -NoTypeInformation
Is it even possible with Get-ADUser
?
You can customize the Select-Object output using a calculated property:
Get-ADUser -SearchBase "OU=11-something,DC=somethingelse,DC=somethingelser"
-Filter {somefilters} -Properties name,mail
|Select-Object Name,@{N="Email";E={$_.mail.ToLower()}}
| Export-Csv -Path "D:\Path"
-Encoding UTF8 -NoTypeInformation