I'm using PS 1.0 on a server 2008 with Exchange 2007.
Script:
It works great, I get all the output I want, but it doesn't get formatted properly for a csv file. It's just clean text, no commas or anything.
Output:
As you can see, it doesn't export the full DN which also annoyes me a lot.
I'm quit new to powershell, so any help appreciated
Script:
Code:
## Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin
get-date -format d
get-mailbox | get-mailboxstatistics | where {$_.ObjectClass -eq "Mailbox"} |ft @{label="User";expression={$_.DisplayName}},@{label="Size(KB)";expression={$_.TotalItemSize.Value.ToKB()}}, @{label="Items";expression={$_.ItemCount}}, @{label="DN";expression={(get-mailbox $_.legacydn).distinguishedname}} > c:\stats.csv
Output:
Code:
User Size(KB) Items DN
---- -------- ----- --
lb1 11498 7 CN=lb1,OU=Brugere,OU=Legep...
lb2 5734 6 CN=lb2,OU=Brugere,OU=Legep...
nb1 11454 7 CN=nb1,OU=Brugere,OU=Legep...
I'm quit new to powershell, so any help appreciated