Hello Everyone, I’m really new to powershell, but I’m trying really hard.
I’m trying to get a list of all my users, there Excahnge DB, and all there emails (including aliasses)
I’ve manage to get most of what I want with
get-aduser -filter * -properties * | select-object CN, Displayname, CanonicalName, SamAccountName, homeMDB, mail, enabled, @{"name"="proxyaddresses":"expression"={$_.proxyaddresses}} | Export-Csv -Encoding Unicode -NoTypeInformation -Delimiter ";" -Path c:\temp\test.csv
Here what is not displaying how I want.
-
homeMDB: I would like the cut the text after the first “,”
-
proxyaddresses: They are all displaying on the same line and they are all prefixed with smtp:
I would like to have them in the same cell in excel, but on different line (like alt+enter when you do it manually) and remove the SMTP: prefix -
I would like also to querry get-mailboxstatistic,to have some thie like
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName, ` @{name=”TotalItemSize (MB)”; expression={[math]::Round( ` ($_.TotalItemSize.ToString().Split(“(“)[1].Split(” “)[0].Replace(“,”,””)/1MB),2)}}, ` ItemCount, LastLogoffTime,LastLogonTime | Sort “TotalItemSize (MB)” -Descending | Export-CSV “C:\temp\All Mailboxes $(get-date -f yyyy-MM-dd).csv” -NoTypeInformation -encoding Unicode -Delimiter ";"
but I really don’t know of to add it in the same report.
Thanks for your kind help and support.
Jean-François Gauthier