none
Exchange 2010 Reporting RRS feed

  • Question

  • Hi,

    I am trying to prepare a scheduled monthly report for my exchange 2010 environment in the below format.

    But, I am not able to get the output of Column 2,4,5,8 & and smtpaddresses in the above format.

    Is it possible to achieve such an output with help of powershell ? If Yes, can someone help me ?

    Thanks in Advance :)

    Ankush Shah


    Saturday, January 4, 2014 6:50 PM

All replies

  • Yes it is possible, Post the script you are using?

    You might want check this free tool as well, and best part is you don;t have to install it.
    http://www.exchangeranger.com/2013/03/exchange-reports-for-exchange-2010-and.html


    Cheers,

    Gulab Prasad,

    Technology Consultant

    Blog: www.exchangeranger.com  Twitter:    LinkedIn:   
    Check out CodeTwo’s tools for Exchange admins   

    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    Saturday, January 4, 2014 7:13 PM
  • Below is the my script, still need to refine this. But as i mentioned need help towards formatting and getting count of incoming & outgoing emails per user

    #************* Function to set start & end dates *************
    function enddate
    {
        Param(
        [Parameter(Mandatory=$True,Position=1)]
        [string]$Month,
        [Parameter(Mandatory=$True,Position=2)]
        [string]$Year   
        )   
        $date=    switch ($month)
        {
         1 {"31/01/$Year"; break}
         2 {"28/02/$Year"; break}
         3 {"31/03/$Year"; break}
         4 {"30/04/$Year"; break}
         5 {"31/05/$Year"; break}
         6 {"30/06/$Year"; break}
         7 {"31/07/$Year"; break}
         8 {"31/08/$Year"; break}
         9 {"30/09/$Year"; break}
         10 {"31/10/$Year"; break}
         11 {"30/11/$Year"; break}
         12 {"31/12/$Year"; break}
        }
    Return $date
    }


    function startdate
    {
        Param(
        [Parameter(Mandatory=$True,Position=1)]
        [string]$Month,
        [Parameter(Mandatory=$True,Position=2)]
        [string]$Year   
        )   
        $date=    switch ($month)
        {
         1 {"01/01/$Year"; break}
         2 {"0/02/$Year"; break}
         3 {"01/03/$Year"; break}
         4 {"01/04/$Year"; break}
         5 {"01/05/$Year"; break}
         6 {"01/06/$Year"; break}
         7 {"01/07/$Year"; break}
         8 {"01/08/$Year"; break}
         9 {"01/09/$Year"; break}
         10 {"01/10/$Year"; break}
         11 {"01/11/$Year"; break}
         12 {"01/12/$Year"; break}
        }
    Return $date
    }

    #************* Function END *************

    #************* Script to Get Mailbox Statistics *************

    $ms = Get-Mailbox | Get-MailboxStatistics | select DisplayName, ItemCount, @{expression={[math]::Round($_.totalitemsize.value.ToKB())};label="TotalItemSizeMB"}
    [array]$stats = $null
    foreach ($m in $ms)
    {
     $myobj1 = New-Object -TypeName PSObject -Property @{DisplayName = $m.DisplayName; ItemCount = $m.ItemCount; TotalItemSizeMB = [Math]::Round($m.TotalItemSizeMB/(1024*1024),2)};$stats+=$myobj1
    }
    $stats | export-csv -path c:\temp\stats.csv -notypeinformation

    #************* Script to Get Mailbox Statistics Ends *************

    #************* Script to Get All Email Addresses *************

    $user=get-mailbox |Select-Object Name -expandproperty emailaddresses |select name, smtpaddress
    $user | Out-File C:\temp\emailaddress.csv -notypeinformation

    #************* Script to Get Email Addresses Ends *************

    #************* Script to Get incoming & outgoing mail count *************

    $date=(Get-Date).addmonths(-1)
    $ed=enddate $date.month $date.year
    $sd=startdate $date.month $date.year

    $sd = $sd + " 00:00:00"
    $ed = $ed + " 23:59:59"

    $user=get-mailbox |Select-Object Name -expandproperty emailaddresses |select name, smtpaddress
    [array]$temp = $null
    foreach ($i in $user){
    $icl = get-messagetrackinglog -recipient ($i.smtpaddress) -start $sd -end $ed -resultsize unlimited
    $temp+=$icl
    }

    [array]$count=$null
    $temp  | where {($_.eventid -eq "Send") -or ($_.eventid -eq "Receive")}
    foreach
    {
    $myobj2=New-Object -TypeName PSObject -Property @{Recipients=[string]$_.Recipients;eventid=$_.eventid}
    $count+=$myobj2
    }

    Monday, January 6, 2014 2:01 PM
  • Hi,

    On the basis of my testing there is a third party tool which can do such task easily and quickly, if you are not still not able to solve in your problem through the power shell scripts. For more details of the tool you can refer to http://www.exchange2010reporting.com/

    Tuesday, January 7, 2014 1:00 PM