I am new to PS, where do I input my user’s email and date in below’s script?? I am wanting accurate Exchange 2010, Sent and Received email totals from 10/1/2018 to 01/31/2019…<\/p>\n
$info = get-mailbox -ResultSize Unlimited | new-object psobject -Property @{ $info<\/p>\n FYI I have tried the following:<\/p>\n Get-TransportServer | Get-MessageTrackingLog -ResultSize Unlimited -Start “10/01/2018” -End “01/31/2019” -Sender “@emailaddress.com<\/span>” -EventID RECEIVE | ? {$_.Source -eq “STOREDRIVER”} | ForEach { $intSent++ } Script is providing sent and received numbers. But if I extend Start range to 01/01/2018 and same end date 01/31/2019 I get same result. So I don’t know if the first result is accurate or not.<\/p>\n Thanks<\/p>","upvoteCount":7,"answerCount":2,"datePublished":"2019-02-07T20:11:07.000Z","author":{"@type":"Person","name":"gohawkeyes","url":"https://community.spiceworks.com/u/gohawkeyes"},"suggestedAnswer":[{"@type":"Answer","text":" I am new to PS, where do I input my user’s email and date in below’s script?? I am wanting accurate Exchange 2010, Sent and Received email totals from 10/1/2018 to 01/31/2019…<\/p>\n $info = get-mailbox -ResultSize Unlimited | new-object psobject -Property @{ $info<\/p>\n FYI I have tried the following:<\/p>\n Get-TransportServer | Get-MessageTrackingLog -ResultSize Unlimited -Start “10/01/2018” -End “01/31/2019” -Sender “@emailaddress.com<\/span>” -EventID RECEIVE | ? {$_.Source -eq “STOREDRIVER”} | ForEach { $intSent++ } Script is providing sent and received numbers. But if I extend Start range to 01/01/2018 and same end date 01/31/2019 I get same result. So I don’t know if the first result is accurate or not.<\/p>\n Thanks<\/p>","upvoteCount":7,"datePublished":"2019-02-07T20:11:07.000Z","url":"https://community.spiceworks.com/t/ps-code-for-on-prem-exchange-2010/696602/1","author":{"@type":"Person","name":"gohawkeyes","url":"https://community.spiceworks.com/u/gohawkeyes"}},{"@type":"Answer","text":" If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n
\nforeach{
\n$received = (Get-MessageTrace -RecipientAddress $.UserPrincipalName -StartDate “$((get-date).ToShortDateString()) 00:00:00” -EndDate “$((get-date).ToShortDateString()) 23:59:59”).count
\n$send = (Get-MessageTrace -SenderAddress $<\/em>.UserPrincipalName -StartDate “$((get-date).ToShortDateString()) 00:00:00” -EndDate “$((get-date).ToShortDateString()) 23:59:59”).count<\/p>\n
\nUserName = $_.UserPrincipalName
\nSendCount = $send
\nReceiveCount = $received
\nDate = (get-date).ToShortDateString()
\n}
\n}<\/p>\n
\nGet-TransportServer | Get-MessageTrackingLog -ResultSize Unlimited -Start “01/03/2018” -End “01/31/2019” -Recipients “@emailaddress.com<\/span>” -EventID DELIVER | ForEach { $intRec++ }
\nWrite-Host \"E-mails sent: \", $intSent
\nWrite-Host “E-mails received:”, $intRec<\/p>\n
\nforeach{
\n$received = (Get-MessageTrace -RecipientAddress $.UserPrincipalName -StartDate “$((get-date).ToShortDateString()) 00:00:00” -EndDate “$((get-date).ToShortDateString()) 23:59:59”).count
\n$send = (Get-MessageTrace -SenderAddress $<\/em>.UserPrincipalName -StartDate “$((get-date).ToShortDateString()) 00:00:00” -EndDate “$((get-date).ToShortDateString()) 23:59:59”).count<\/p>\n
\nUserName = $_.UserPrincipalName
\nSendCount = $send
\nReceiveCount = $received
\nDate = (get-date).ToShortDateString()
\n}
\n}<\/p>\n
\nGet-TransportServer | Get-MessageTrackingLog -ResultSize Unlimited -Start “01/03/2018” -End “01/31/2019” -Recipients “@emailaddress.com<\/span>” -EventID DELIVER | ForEach { $intRec++ }
\nWrite-Host \"E-mails sent: \", $intSent
\nWrite-Host “E-mails received:”, $intRec<\/p>\n