Thought I'd make a new thread about this.
My current script exports mailbox information to a csv file, but I want to add the date to the table.
Script (without export part):
I haven't polished the script yet, but this works so far.
I have tried addin different lines, but I can't quite figure out how to do this.
Obviously adding a get-date doesn't work at either end of this script, as the current date is no where to be found in the mailbox.
Neither works at any end of the script :/
Any help appreciated, as always!
My current script exports mailbox information to a csv file, but I want to add the date to the table.
Script (without export part):
Code:
get-mailbox | get-mailboxstatistics | where {$_.ObjectClass -eq "Mailbox"} | Select-Object @{name="Username";expression={$_.DisplayName}},@{name="Size";expression={$_.TotalItemSize.Value.ToKB()}}, @{name="Items";expression={$_.ItemCount}}, @{name="DN";expression={(get-mailbox $_.legacydn).distinguishedname}}
I have tried addin different lines, but I can't quite figure out how to do this.
Obviously adding a get-date doesn't work at either end of this script, as the current date is no where to be found in the mailbox.
Code:
get-date -format d | get-mailbox | get-mailboxstatistics
Code:
| get-date @{name="Dato";expression={(get-date)}}
Any help appreciated, as always!