kempchen
Goto Top

Auswertung E-Mailverkehr von Gruppen Postfächern im Exchange 2010

Hallo Zusammen,


wir haben bei uns eine Reservierungsabteilung welche mit Gruppenpostfächern arbeitet.
Nun habe ich die Aufgabenstellung erhalten, dass man den E-Mailverkehr (Anzahl ein- / ausgehend) auswerten möchte und in einem Diagramm am besten bereitstellen möchte erhalten.

Ich kenne zwar ein Tool (MailDetectiv falls es wer kennen sollte) nur kommt dies in diesem Fall nicht in Frage.... jetzt suche ich nach einer Alternative zu diesem tool.

Vielleicht kennt ja wer von euch eine gute Alternative darf auch was kosten.

Besten Dank für eure Hilfe.

Kempchen

Content-ID: 246393

Url: https://administrator.de/forum/auswertung-e-mailverkehr-von-gruppen-postfaechern-im-exchange-2010-246393.html

Ausgedruckt am: 15.04.2025 um 01:04 Uhr

colinardo
colinardo 13.08.2014 aktualisiert um 19:05:03 Uhr
Goto Top
Hallo Kempchen,
gibt's auch umesöns mit Powershellauswertung und Excel:
http://blogs.technet.com/b/neiljohn/archive/2011/08/09/user-profile-ana ...

Grüße Uwe
Kempchen
Kempchen 14.08.2014 um 16:54:06 Uhr
Goto Top
Hallo Uwe,

danke für deine rasche Hilfestellung.

Leider kann ich mit dem Script aktuell nix anfangen, weil dieser das Falsche Datumformat verwendet und ich nicht tief genug in der PS-Programmierung drinnen bin um diese so abzuändern, dass der diese ins Deutsche Zeitformat ändert.

@all sollte sonst jemand eine Idee haben würde ich mich sehr über Unterstützung freuen.

VG
Kempchen
colinardo
colinardo 14.08.2014 aktualisiert um 20:33:59 Uhr
Goto Top
Ja, das habe ich damals auch feststellen müssen, das es nicht mehr ganz aktuell ist.
Habe dir das Script von der obigen Seite ein wenig angepasst:
Du rufst das Script dann mit folgenden zwei Parametern auf, die selbsterklärend sein sollten (Start- und Enddatum für das Erfassen des gewünschten Zeitraumes). Die CSV-Dateien landen dann im aktuellen Verzeichnis.
.\GetEMailStats.ps1 -startdate "01.01.2014" -enddate "14.08.2014"
back-to-topGetEMailStats.ps1 (wurde etwas angepasst / das Ursprungsscript stammt von dieser Seite)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
param(
    [parameter(mandatory=$true)][string]$start,
    [parameter(mandatory=$true)][string]$ende
)
$today = get-date 
$rundate = $today
$startdate = get-date $start
$enddate = (get-date $ende).AddDays(1).AddSeconds(-1)

$outfile_date = $rundate.toString("yyyy_MM_dd")  
$outfile = "email_stats_" + $outfile_date + ".csv"   
 
$dl_stat_file = "DL_stats.csv"   
 
$accepted_domains = Get-AcceptedDomain |% {$_.domainname.domain} 
[regex]$dom_rgx = "`(?i)(?:" + (($accepted_domains |% {"@" + [regex]::escape($_)}) -join "|") + ")$"   
 
$mbx_servers = Get-ExchangeServer |? {$_.serverrole -match "Mailbox"}|% {$_.fqdn}   
[regex]$mbx_rgx = "`(?i)(?:" + (($mbx_servers |% {"@" + [regex]::escape($_)}) -join "|") + ")\>$"   
 
$msgid_rgx = "^\<.+@.+\..+\>$"   
 
$hts = get-exchangeserver |? {$_.serverrole -match "hubtransport"} |% {$_.name}   
 
$exch_addrs = @{} 
 
$msgrec = @{} 
$bytesrec = @{} 
 
$msgrec_exch = @{} 
$bytesrec_exch = @{} 
 
$msgrec_smtpext = @{} 
$bytesrec_smtpext = @{} 
 
$total_msgsent = @{} 
$total_bytessent = @{} 
$unique_msgsent = @{} 
$unique_bytessent = @{} 
 
$total_msgsent_exch = @{} 
$total_bytessent_exch = @{} 
$unique_msgsent_exch = @{} 
$unique_bytessent_exch = @{} 
 
$total_msgsent_smtpext = @{} 
$total_bytessent_smtpext = @{} 
$unique_msgsent_smtpext=@{} 
$unique_bytessent_smtpext = @{} 
 
$dl = @{} 
 
 
$obj_table = { 
@"   
StartDate = $(get-date $startdate -Format "dd.MM.yyyy HH:mm:ss")  
EndDate = $(get-date $enddate -Format "dd.MM.yyyy HH:mm:ss")  
User = $($address.split("@"))   
Domain = $($address.split("@")[1])   
Sent Total = $(0 + $total_msgsent[$address]) 
Sent MB Total = $("{0:F2}" -f $($total_bytessent[$address]/1mb))   
Received Total = $(0 + $msgrec[$address]) 
Received MB Total = $("{0:F2}" -f $($bytesrec[$address]/1mb))   
Sent Internal = $(0 + $total_msgsent_exch[$address]) 
Sent Internal MB = $("{0:F2}" -f $($total_bytessent_exch[$address]/1mb))   
Sent External = $(0 + $total_msgsent_smtpext[$address]) 
Sent External MB = $("{0:F2}" -f $($total_bytessent_smtpext[$address]/1mb))   
Received Internal = $(0 + $msgrec_exch[$address]) 
Received Internal MB = $("{0:F2}" -f $($bytesrec_exch[$address]/1mb))   
Received External = $(0 + $msgrec_smtpext[$address]) 
Received External MB = $("{0:F2}" -f $($bytesrec_smtpext[$address]/1mb))   
Sent Unique Total = $(0 + $unique_msgsent[$address]) 
Sent Unique MB Total = $("{0:F2}" -f $($unique_bytessent[$address]/1mb))   
Sent Internal Unique  = $(0 + $unique_msgsent_exch[$address])  
Sent Internal Unique MB = $("{0:F2}" -f $($unique_bytessent_exch[$address]/1mb))   
Sent External  Unique = $(0 + $unique_msgsent_smtpext[$address]) 
Sent External Unique MB = $("{0:F2}" -f $($unique_bytessent_smtpext[$address]/1mb))   
"@   
} 
 
$props = $obj_table.ToString().Split("`n")|% {if ($_ -match "(.+)="){$matches[1].trim()}}   
 
$stat_recs = @() 
 
function time_pipeline { 
param ($increment  = 1000) 
begin{$i=0;$timer = [diagnostics.stopwatch]::startnew()} 
process { 
    $i++ 
    if (!($i % $increment)){Write-host “`rProcessed $i in $($timer.elapsed.totalseconds) seconds” -nonewline} 
    $_ 
    } 
end { 
    write-host “`rProcessed $i log records in $($timer.elapsed.totalseconds) seconds” 
    Write-Host "   Average rate: $([int]($i/$timer.elapsed.totalseconds)) log recs/sec."   
    } 
} 
 
foreach ($ht in $hts){ 
 
    Write-Host "`nStarted processing $ht"   
 
    get-messagetrackinglog -Server $ht -Start $startdate -End $enddate -resultsize unlimited | 
    time_pipeline |%{ 
     
     
    if ($_.eventid -eq "DELIVER" -and $_.source -eq "STOREDRIVER"){   
     
        if ($_.messageid -match $mbx_rgx -and $_.sender -match $dom_rgx) { 
             
            $total_msgsent[$_.sender] += $_.recipientcount 
            $total_bytessent[$_.sender] += ($_.recipientcount * $_.totalbytes) 
            $total_msgsent_exch[$_.sender] += $_.recipientcount 
            $total_bytessent_exch[$_.sender] += ($_.totalbytes * $_.recipientcount) 
         
            foreach ($rcpt in $_.recipients){ 
            $exch_addrs[$rcpt] ++ 
            $msgrec[$rcpt] ++ 
            $bytesrec[$rcpt] += $_.totalbytes 
            $msgrec_exch[$rcpt] ++ 
            $bytesrec_exch[$rcpt] += $_.totalbytes 
            } 
             
        } 
         
        else { 
            if ($_messageid -match $messageid_rgx){ 
                    foreach ($rcpt in $_.recipients){ 
                        $msgrec[$rcpt] ++ 
                        $bytesrec[$rcpt] += $_.totalbytes 
                        $msgrec_smtpext[$rcpt] ++ 
                        $bytesrec_smtpext[$rcpt] += $_.totalbytes 
                    } 
                } 
         
            } 
                 
    } 
     
     
    if ($_.eventid -eq "RECEIVE" -and $_.source -eq "STOREDRIVER"){   
        $exch_addrs[$_.sender] ++ 
        $unique_msgsent[$_.sender] ++ 
        $unique_bytessent[$_.sender] += $_.totalbytes 
         
            if ($_.recipients -match $dom_rgx){ 
                $unique_msgsent_exch[$_.sender] ++ 
                $unique_bytessent_exch[$_.sender] += $_.totalbytes 
                } 
 
            if ($_.recipients -notmatch $dom_rgx){ 
                $ext_count = ($_.recipients -notmatch $dom_rgx).count 
                $unique_msgsent_smtpext[$_.sender] ++ 
                $unique_bytessent_smtpext[$_.sender] += $_.totalbytes 
                $total_msgsent[$_.sender] += $ext_count 
                $total_bytessent[$_.sender] += ($ext_count * $_.totalbytes) 
                $total_msgsent_smtpext[$_.sender] += $ext_count 
                 $total_bytessent_smtpext[$_.sender] += ($ext_count * $_.totalbytes) 
                } 
                                
             
        } 
         
    if ($_.eventid -eq "expand"){   
        $dl[$_.relatedrecipientaddress] ++ 
        } 
    }      
     
} 
 
foreach ($address in $exch_addrs.keys){ 
 
$stat_rec = (new-object psobject -property (ConvertFrom-StringData (&$obj_table))) 
$stat_recs += $stat_rec | select $props 
} 
 
$stat_recs | export-csv $outfile -notype -Delimiter ";"  
 
if (Test-Path $dl_stat_file){ 
    $DL_stats = Import-Csv $dl_stat_file 
    $dl_list = $dl_stats |% {$_.address} 
    } 
     
else { 
    $dl_list = @() 
    $DL_stats = @() 
    } 
 
 
$DL_stats |% { 
    if ($dl[$_.address]){ 
        if ([datetime]$_.lastused -le [datetime]$rundate){  
            $_.used = [int]$_.used + [int]$dl[$_.address] 
            $_.lastused = $rundate 
            } 
        } 
} 
     
$dl.keys |% { 
    if ($dl_list -notcontains $_){ 
        $new_rec = "" | select Address,Used,Since,LastUsed   
        $new_rec.address = $_ 
        $new_rec.used = $dl[$_] 
        $new_rec.Since = $rundate 
        $new_rec.lastused = $rundate 
        $dl_stats += @($new_rec) 
    } 
} 
 
$dl_stats | Export-Csv $dl_stat_file -NoTypeInformation -force -Delimiter ";"  
 
 
Write-Host "`nRun time was $(((get-date) - $today).totalseconds) seconds."   
Write-Host "Email stats file is $outfile"   
Write-Host "DL usage stats file is $dl_stat_file"   
Grüße Uwe
goserver
goserver 18.08.2014 um 09:40:22 Uhr
Goto Top
Probiere es mal mit Jamsoftware: Smarttoolbox für Exchange.
Da kann man den E-Mail Verkehr in eine Datenbank reinschreiben (SQL Server) o.a.
Außerdem Spamfilter usw.

Kannst das Teil 30 Tage testen, bei Bedarf kann ich dir das günstiger besorgen.
Viel Spaß