Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Export to CSV

26 views
Skip to first unread message

Michael Zipperer

unread,
Dec 10, 2015, 3:34:09 AM12/10/15
to
Hello!

I have the following powershell script:

$ADGruppe = Read-Host "Bitte Benutzergruppe eingeben"
$Datum = Get-Date -Format yyyyMd
$File = "c:\Temp\" + $ADGruppe + "_" + $Datum + ".csv"
Import-Module ActiveDirectory
$Results = Get-ADGroupMember $ADGruppe | Get-ADUser | forEach {Get-MailboxStatistics -Identity $_.name} | export-csv -path $File -Encoding UTF8

This script works fine and i can see the the mailsboxsize for all users in the choosen group. But I get many information in the csv file that i don't need. For me it would be enough to see the Displayname and the TotalItems.

Has anyone an idea how i do this?

Thank you in advance

Michael

Jürgen Exner

unread,
Dec 10, 2015, 9:09:45 AM12/10/15
to
On Thu, 10 Dec 2015 00:34:08 -0800 (PST), Michael Zipperer
<michael....@gmail.com> wrote in
microsoft.public.windows.powershell:

[Please limit your line length to ~75 characters as has been a proven
custom on Usenet for 3 decades. Thank you]

>$Results = Get-ADGroupMember $ADGruppe | Get-ADUser | forEach {Get-MailboxStatistics -Identity $_.name} | export-csv -path $File -Encoding UTF8
>
>This script works fine and i can see the the mailsboxsize for all users in the choosen group. But I get many information in the csv file that i don't need. For me it would be enough to see the Displayname and the TotalItems.

I don't know what data type Get-MailboxStatistics returns.
Just take a look at it by using "get-member" and check what actions are
available for that output object.

jue
0 new messages