Exchange 2010 Reporting

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

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

Similar Messages

  • Unable to generate two Exchange 2010 reports

    i
    I am using SCOM 2007 R2 and I am not able to pull the below Exchange 2010 reports in SCOM. till Last month its working fine and now the issue started.
    1. Report Name: Microsoft.Exchange.2010.Reports.Transport.Platform.TopUsers
    Error Message
    Date: 2014-09-12 22:02:22
    Application: System Center Operations Manager 2007 R2
    Application Version: 6.1.7221.81
    Severity: Error
    Message: Cannot initialize report.
    Microsoft.Reporting.WinForms.ReportServerException: An internal error occurred on the report server. See the error log for more details. (rsInternalError) ---> Microsoft.Reporting.WinForms.ReportServerException: For more information about this error
    navigate to the report server on the local server machine, or enable remote errors
       --- End of inner exception stack trace ---
       at Microsoft.Reporting.WinForms.ServerReport.GetExecutionInfo()
       at Microsoft.Reporting.WinForms.ServerReport.GetParameters()
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Reporting.Parameters.ReportParameterBlock.Initialize(ServerReport serverReport)
       at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ReportForm.SetReportJob(Object sender, ConsoleJobEventArgs args)
    Microsoft.Reporting.WinForms.ReportServerException: For more information about this error navigate to the report server on the local server machine, or enable remote errors
    2.Microsoft.Exchange.2010.Reports.SLA
    Error Message:
    An error has occured during report processing.
    Query execution failed for dataset 'OutageBreakdown'
    For more information about this error navigate to the report server on the local server machine, or enable remote errors.
    Please help us to resolve this issue.
    Donald D'souza (http://donald-scom.blogspot.com/)

    Regarding the error, please also try the following methods:
    Error message when you try to generate a report in System Center Operations Manager 2007: "Cannot initialize report"
    http://support.microsoft.com/kb/942865
    SCOM - "Cannot initialize report" error
    http://blogs.technet.com/b/csstwplatform/archive/2009/02/16/scom-cannot-initialize-report-error.aspx
    SCOM R2 Console error message: Cannot initialize report.
    http://thoughtsonopsmgr.blogspot.com/2010/04/scom-r2-console-error-message-cannot.html
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical | Twitter:
    Mai Ali

  • "Microsoft.Exchange.2010.Reports.Transport.Platform.TopUsers "Report show no result

    hello,
          i have an issue in my SCOM 2012 report.when i go to
    Reporting --> Exchange Server 2010 Report Library-->and open the report Microsoft.Exchange.2010.Reports.Transport.Platform.Top users.
    in my scom 2012 console and execute the report for top users on the basis of Messages Send or Messages Received ,it return zero result.
    thank you

    Hi,
    Blank reports can be a common issue with System Center Operations Manager. These are caused by many different reasons, and for the focus of this article we will discuss the following:
    1. The wrong type of entity was selected as the report target.
    2. The corresponding performance collection rule or the script that generates the performance data is not enabled for the report target.
    3. There is a functional problem with the Health Service on the agent.
    4. Management servers are unable to insert data into the OperationsManagerDW database.
    5. Data is stuck in the staging tables in the OperationsManagerDW database.
    More details:
    https://support2.microsoft.com/kb/2573329?wa=wsignin1.0
    In addition, it is suggested to configure the Exchange management pack  according to the mangement pack guide.
    And here are two links that should be helpful for you regarding to this issue, please refer to them:
    http://zoomindia111.wordpress.com/configure-exchange-2010-sp1-management-pack-in-scom-2007-r2/
    http://blogs.technet.com/b/emreguclu/archive/2011/09/26/empty-exchange-2010-server-statistics-mailflow-reports-if-default-log-directory-has-changed.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • Incorrect Report duration in CAS Exchange 2010 Reports

    Hi ,
    We are facing issues in our Exchange 2010 reports where Reports are coming blank. We had an DWH aggregation issue in the past with the Exchange dataset. With the help of Microsoft we had caught up the aggregation manually. Post that the Exchange reports are
    coming blank.
    What could be done to fix the issue.
    Regards,
    Jesty

    First go to the event viewer, Application, Operations Manager and look if errors related to the Exchange Reports are raised. Verify that you enable rules.
    For empty Exchange 2010 Server Statistics/Mailflow Reports
    http://blogs.technet.com/b/emreguclu/archive/2011/09/26/empty-exchange-2010-server-statistics-mailflow-reports-if-default-log-directory-has-changed.aspx
    http://www.dario.co.il/?p=968
    Also you can check below link for blank reports
    http://support.microsoft.com/kb/2573329
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical | Twitter:
    Mai Ali

  • Exchange 2010 - Report NDRs with powershell

    Hi all,
    I would like to analyze all internal NDRs within my exchange environment. For example we have systems which are hard coded with email addresses of internal recipients and people leave the business and their mailbox and associated email address will be removed
    from exchange but not from a third party system that has a list of addresses to send notifications out to or home grown scripts. In order to keep the email pipeline clean and follow best practices I would like to catch these NDRs and remove them from the relevant
    systems.
    Is there anyway I can do this with powershell, my environment Exchange 2010 SP2 and all the roles are on a single server.

    Hi Niko,
    I have just performed the following test:
    sent an email to an internal recipient were the address does not exist, example
    [email protected]
    The NDR does not come from [email protected]
    The headers for the NDR I got as listed below:
    MIME-Version: 1.0
    From: Microsoft Outlook
     <[email protected]>
    To: <[email protected]>
    Date: Thu, 11 Dec 2014 08:55:54 +0000
    Content-Type: multipart/report; report-type=delivery-status;
     boundary="129b7383-6632-4979-ab4a-e5742a33ae6b"
    X-MS-Exchange-Organization-SCL: -1
    Content-Language: en-GB
    Message-ID: <[email protected]>
    In-Reply-To: <[email protected]com>
    References: <[email protected]com>
    Thread-Topic: test
    Thread-Index: AdAVIEZfXlpAxeICRk2Dg71q+Amr/wAAADyf
    Subject: Undeliverable: test
    X-MS-Exchange-Organization-AuthSource: exchangeserver.mydomain.com
    X-MS-Exchange-Organization-AuthAs: Internal
    X-MS-Exchange-Organization-AuthMechanism: 05

  • Exchange 2010 report not working

    Hi all,
    I'm trying to compose a mailbox size report for Exchange 2010. The output is to an html file that is automatically emailed to whoever I wish it to be. The functionality works GREAT, but the report is outputting no data. Can someone tell me why? I have multiple
    databases, but it still shouldn't output a file with NO data. Here is the script:
    #Variables to configure
    $MailServer = "my mail server"
    $ReportSender = "my email"
    $ReportRecipient = "their email"
    $MailSubject = ("Mailbox Report for " + $MailServer + " - " + ( get-date ).ToString('yyyy/MM/dd'))
    #SendEmailFunction
    Function sendEmail
    { param($smtphost,$htmlFileName)
    $smtp= New-Object System.Net.Mail.SmtpClient$smtphost
    $msg = New-Object System.Net.Mail.MailMessage $ReportSender, $ReportRecipient, $MailSubject, (Get-Content $htmlFileName)
    $msg.isBodyhtml = $true
    $smtp.send($msg)
    $exdata = Get-MailboxStatistics -Server $MailServer | Sort-Object TotalItemSize -descending | Select-Object DisplayName, ItemCount, TotalItemSize, StorageLimitStatus
    $fileName = "exchange2010Report.html"
    New-Item -ItemType file $fileName -Force
    # HTML start
    Add-Content $fileName "<html>"
    # HEAD start
    Add-Content $fileName "<head>"
    add-content $fileName '<STYLE TYPE="text/css">'
    add-content $fileName  "<!--"
    add-content $fileName  "td {"
    add-content $fileName  "font-family: Tahoma;"
    add-content $fileName  "font-size: 11px;"
    add-content $fileName  "border-top: 1px solid #999999;"
    add-content $fileName  "border-right: 1px solid #999999;"
    add-content $fileName  "border-bottom: 1px solid #999999;"
    add-content $fileName  "border-left: 1px solid #999999;"
    add-content $fileName  "padding-top: 0px;"
    add-content $fileName  "padding-right: 0px;"
    add-content $fileName  "padding-bottom: 0px;"
    add-content $fileName  "padding-left: 0px;"
    add-content $fileName  "}"
    add-content $fileName  "body {"
    add-content $fileName  "margin-left: 5px;"
    add-content $fileName  "margin-top: 5px;"
    add-content $fileName  "margin-right: 0px;"
    add-content $fileName  "margin-bottom: 10px;"
    add-content $fileName  ""
    add-content $fileName  "table {"
    add-content $fileName  "border: thin solid #000000;"
    add-content $fileName  "}"
    add-content $fileName  "-->"
    add-content $fileName  "</style>"
    # HEAD end
    Add-Content $fileName "</head>"
    # HEAD start
    Add-Content $fileName "<body>"
    # TABLE start
    Add-Content $fileName "<table width='100%'>"
    # TABLE Header
    Add-Content $fileName "<tr bgcolor='#7C7C7C'>"
    Add-Content $fileName "<td width='35%'>DisplayName</td>"
    Add-Content $fileName "<td width='10%'>ItemCount</td>"
    Add-Content $fileName "<td width='10%'>TotalItemSize</td>"
    Add-Content $fileName "<td width='25%'>Database</td>"
    Add-Content $fileName "<td width='20%'>StorageLimitStatus</td>"
    Add-Content $fileName "</tr>"
    $alternateTableRowBackground = 0
    # TABLE Content
    while($alternateTableRowBackground -le $exdata.length)
    if(($alternateTableRowBackground % 2) -eq 0)
    Add-Content $fileName "<tr bgcolor='#CCCCCC'>"
    else
    Add-Content $fileName "<tr bgcolor='#FCFCFC'>"
    Add-Content $fileName ("<td width='30%'>" + $exdata[$alternateTableRowBackground].DisplayName + "</td>")
    Add-Content $fileName ("<td width='10%'>" + $exdata[$alternateTableRowBackground].ItemCount + "</td>")
    Add-Content $fileName ("<td width='15%'>" + $exdata[$alternateTableRowBackground].TotalItemSize + "</td>")
    Add-Content $fileName ("<td width='25%'>" + $exdata[$alternateTableRowBackground].Database+ "</td>")
    #BelowLimit or NoChecking
    if(($exdata[$alternateTableRowBackground].StorageLimitStatus -eq "BelowLimit") -or ($exdata[$alternateTableRowBackground].StorageLimitStatus -eq "NoChecking"))
    Add-Content $fileName ("<td bgcolor='#007F00' width='20%'>" + $exdata[$alternateTableRowBackground].StorageLimitStatus+ "</td>")
    #IssueWarning
    if($exdata[$alternateTableRowBackground].StorageLimitStatus -eq "IssueWarning")
    Add-Content $fileName ("<td bgcolor='#7F7F00' width='20%'>" + $exdata[$alternateTableRowBackground].StorageLimitStatus+ "</td>")
    #ProhibitSend or MailboxDisabled
    if(($exdata[$alternateTableRowBackground].StorageLimitStatus -eq "ProhibitSend") -or ($exdata[$alternateTableRowBackground].StorageLimitStatus -eq "MailboxDisabled"))
    Add-Content $fileName ("<td bgcolor='#7F0000' width='20%'>" + $exdata[$alternateTableRowBackground].StorageLimitStatus+ "</td>")
    Add-Content $fileName "</tr>"
    $alternateTableRowBackground = $alternateTableRowBackground + 1
    # Summe Mailboxsize
    Add-Content $fileName "<tr bgcolor='#7C7C7C'>"
    Add-Content $fileName ("<td width='30%'></td>")
    $tempdata = MailboxStatistics -Server $MailServer | %{$_.ItemCount} | Measure-Object -Sum
    Add-Content $fileName ("<td width='10%'>" + ($tempdata | Select-Object -expand Sum) + "</td>")
    $tempdata = MailboxStatistics -Server $MailServer | %{$_.TotalItemSize.Value.ToMB()} | Measure-Object -Sum
    Add-Content $fileName ("<td width='15%'>" + ($tempdata | Select-Object -expand Sum) + " MB</td>")
    Add-Content $fileName ("<td width='25%'></td>")
    Add-Content $fileName ("<td width='20%'></td>")
    #TABLE end
    Add-Content $fileName "</table>"
    # HEAD end
    Add-Content $fileName "</body>"
    # HTML end
    Add-Content $fileName "</html>"
    sendEmail $MailServer $fileName
    Any help is appreciated. Thanks!

    You can make it simple on the HTML format...Try the below format on replacement of HTML format page..
    ## HTML PAGE FORMAT
    $a = “<style>”
    $a = $a + “BODY{background-color:Lavender;}”
    $a = $a + “TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}”
    $a = $a + “TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:Bisque}”
    $a = $a + “TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:Beige}”
    $a = $a + “</style>”
    ## HTML PAGE FORMAT
    $exdata = Get-MailboxStatistics -Server $MailServer | Sort-Object TotalItemSize -descending | Select-Object DisplayName, ItemCount, TotalItemSize, StorageLimitStatus | ConvertTo-Html -body “<h2> Mailbox Size Users List Report</h2>” -head $a |
    Set-Content c:\temp\Exchange2013UserReport.html
    Exchange Queries

  • Issue with SLA reports of Exchange 2010 MP in SCOM 2007 R2 !!

    Hi,
    I have issues with Exchange 2010 MP SLA reporting. Whenever report is run it fails on some or the other dataset(Outage**,SLAbyDAte etc.) When I digged in, I found that it is connecting to DW Exchange 2010 Availability tables + Planned maintainance +
    outage table. The tables were not available in the DW, not sure how it got removed. Initially I tried by uninstalling and installing MP(Exchange 2010  & Exchange 2010 reports both) if relevant tables get created automatically but it did
    not help and I was still facing the same issue. Then I tried to create the tables manually and check if it could resolve the issue. There was unique ID associated(different in different computer) with the name of most of the tables. I tool it from Exchange
    report data source which exists in reporting server. But I could see that table remain empty with no records there and SLA report start giving different issues stating table instances do not exist.
    Could anyone help me to restore the SLA report of Exchange 2010 MP ? How should I ensure that data start populating the tables ? I am also helpless here because we do not have correct DW dump to restore back to earlier when it was working fine.
    //BR

    Hi,
    Based on my research, to correctly install the Correlation Engine, consider the following when you install the Exchange 2010 Monitoring Management Pack:
    Determine which server will host the Correlation Engine. While not strictly required, it's strongly recommended that the Correlation Engine be installed on the Root Management Server computer.
    Make sure that you download and install the Exchange 2010 Management Pack that matches the operating system for the selected server. You can install the 32-bit or 64-bit version.
    Make sure that you run the Microsoft Installer (.msi) package on the server where you want the Exchange 2010 Management Pack and the Correlation Engine to be installed.
    After the installation is complete, the Correlation Engine service will have been installed on the server, and the Management Pack files will have been copied to the
    System Center Management Packs folder. By default, the installation directory is C:\Program Files\System Center Management Pack.
    Quote from:
    http://technet.microsoft.com/en-us/library/ee758051(v=exchg.140).aspx
    In addition, here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/e75e84d9-0c9e-4d83-b3da-45a143757f85/exchange-2010-monitoring-with-scom-2012-correlation-service-issue
    Regads,
    Yan Li
    Regards, Yan Li

  • Microsoft Exchange CAS Reports blank

    Hi ,
    We are facing issues in our Exchange 2010 reports where Reports are coming blank. We had an DWH aggregation issue in the past with the Exchange dataset. With the help of Microsoft we had caught up the aggregation manually. Post that the Exchange reports
    are coming blank.
    What could be done to fix the issue.
    Regards,
    Jesty

    Hi,
    Regarding the reports, please refer to:
    Operations Manager Management Pack for Exchange 2010 Guide - Appendix: Reports
    http://technet.microsoft.com/en-us/library/ee758042(EXCHG.140).aspx
    For more information about the Exchange Server 2010 Management Pack, please also see the management pack guide:
    Exchange Server 2010 Monitoring Management Pack
    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7150bfed-64a4-42a4-97a2-07048cca5d23
    Otherwise, your question seems to be related to Exchange 2010. You may also choose to post there to get more effictive help.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Exchange 2010 SP3 Create Dynamic DL for Direct Reports

    I am not sure this is possible but if there is a will there is a way I guess.
    System: Exchange 2010 SP3 on Windows Server 2008 R2
    I am trying to see if there is a way to create dynamic DLs for Manager(s) direct reports.
    Example: Manager has 5 people that report directly to them, is there a way to make an dynamic email distribution list that will poll the direct reports as people leave or hired.
    I know I can create one manually but some depts. may have high turnover rates which increase overhead so I am just trying to simplify the process. I of course googled my question but not getting the results I intended.
    Thanks. 

    hi,
    as from above  i understand you are asking about creating an custom attribute and then referencing them .. if yes please check below command
    Get-Mailbox -OrganizationalUnit Sales | Set-Mailbox CustomAttribute1 "SalesOU"Now you can create an e-mail address policy for all recipients that have the CustomAttribute1 property that equals SalesOU, as shown in this example.
    New-EmailAddressPolicy -Name "Sales" -RecipientFilter { CustomAttribute1 -eq "SalesOU"} -EnabledEmailAddressTemplates "SMTP:%s%[email protected] check this.. http://technet.microsoft.com/en-us/library/ee423541%28v=exchg.150%29.aspx
    MARK AS USEFUL/ANSWER IF IT DID
    Thanks
    Happiness Always
    Jatin

  • I Need to Export to CSV or report on HTML this result of two scripts in power shell on Exchange 2010 or 2013

    I Need to Export in on Report to CSV or  HTML this result of two scripts in power shell on Exchange 2010.
    Get-Mailbox | Select-Object DisplayName, IssueWarningQuota
    and
    ; Get-MailboxStatistics -server MYSERVER | Select-Object DisplayName, TotalItemSize, Itemcount, StorageLimitStatus, Database, IssueWarningQuota | Export-Csv Reporte.csv -notypeinformation

    Hi,
    Please try the command below:
    Get-Mailbox -server servername | select-object DisplayName,@{l='TotalItemSize';e={(Get-MailboxStatistics -identity $_.identity).TotalItemSize}},@{l='Itemcount';e={(Get-MailboxStatistics -identity $_.identity).Itemcount}},@{l='StorageLimitStatus';e={(Get-MailboxStatistics
    -identity $_.identity).StorageLimitStatus}},@{l='Database';e={(Get-MailboxStatistics -identity $_.identity).Database}},IssueWarningQuota | Export-Csv C:\mbxstatistics.csv -notypeinformation
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Exchange 2010: ActiveSync Report shows large amount of hits. So what should I do?

    Hello,
    We currently use the ActiveSync Report to run a daily report of Hits on the Exchange 2010 SP3 RU5 CAS servers (http://blogs.technet.com/b/exchange/archive/2012/01/31/a-script-to-troubleshoot-issues-with-exchange-activesync.aspx)
    The script will report a large number of hits for several users, for different reasons. The question I have is what do we do about it? It's great to know we have a large number of hits, but I'm not sure why and what to do about it.
    Examples:
    1) No User, DeviceID, DeviceType (the columns are blank) and it shows 19,000 hits. Almost all are from IIS_4xx (what does that mean?)
    2) A user with 16,200 hits and it looks like 15,661 were from PING
    3) A user with 3,493 hits and it looks like 3224 were from SYNC
    Any advice on how to investigate and resolve the data that the daily script for ActiveSync hits reports?
    Thanks!

    WHY are there so many PINGS for some device, and so many SYNC for others. And why is one deviceID/UserID blank?
    because it is how the ActiveSync Client is setup. You will need to have the users to upgrade their client. for e.g. iOS verion (dont remember the version number) has some severe issue back in the past and brought down the CAS server due to so much log generation.
    If your user still have the old OS/iOS on their device then you have to have them upgrade.
    Why the userid or device id is blank --  I have no idea but I can't of there may be some Android devices.
    Where Technology Meets Talent

  • Generate ActiveSync Report Exchange 2010

    Hello!
    I would like to create a activesync report with Powershell in Exchange 2010 with users and devices from the last 30 days. I would like these attributes in the report:
    - Display Name
    - Department or Company
    - Primarysmtpaddress
    - DeviceType
    - DeviceModel
    - DeviceOS
    - FirstSyncTime
    - LastSuccessSync
     I've found a lot of scripts, but none with the Company or Department attribute from the Active Directory included. 
    If anyone has a script for this, I would be truly grateful. 
    Regards, Christian 
    Christian Andersson, Exchange 2010 Administrator Jönköping Municipality, Sweden

    This should get you started.  In the event that some users might have multiple devices registered in the last thirty days for a single account, you'll need to add an additional if logic for $ActiveSyncInfo.Count (if gt 1 -> foreach loop)
    $Mailboxes = Get-Mailbox -ResultSize "unlimited"
    $Date = Get-Date
    $CSVPath = "c:\yoursavepathhere"
    $CSVHeader = "DisplayName,Department,PrimarySMTPAddress,DeviceType,DeviceModel,DeviceOS,FirstSyncTime,LastSuccessSync"
    $CSVHeader | Out-File -FilePath $CSVPath -Encoding ASCII
    Foreach ($Mailbox in $Mailboxes)
    $ActiveSyncInfo = $null
    $ActiveSyncInfo = Get-ActiveSyncDeviceStatistics -Mailbox $Mailbox | Where-Object {$_.LastSuccessSync -ge $Date.AddDays(-30)}
    If ($ActiveSyncInfo -ne $null)
    $ADInfo = Get-ADUser -Identity $Mailbox -Properties "Department"
    $DisplayName = $Mailbox.DisplayName
    $Department = $ADinfo.Department
    $PrimarySMTP = $Mailbox.PrimarySmtpAddress
    $DeviceType = $ActiveSyncInfo.DeviceType
    $DeviceModel = $ActiveSyncInfo.DeviceModel
    $DeviceOS = $ActiveSyncInfo.DeviceOS
    $FirstSync = $ActiveSyncInfo.FirstSyncTime
    $LastSuccess = $ActiveSyncInfo.LastSuccessSync
    [String]$CSVAdd = $DisplayName + "," + $Department + "," + $PrimarySMTP + "," + $DeviceType + "," + $DeviceModel + "," + $DeviceOS + "," + $FirstSync + "," + $LastSuccess
    $CSVAdd | Out-File -FilePath $CSVPath -Encoding ASCII -Append
    Thanks! This helped me alot :) 
    Regards, Christian 
    Christian Andersson, Exchange 2010 Administrator Jönköping Municipality, Sweden

  • Turning off 504 non reporting performance collection rules in the Exchange 2010 MP

    Hello
    I read the following MS article about tuning the Exchange 2010 Management Pack
    http://support.microsoft.com/kb/2592561
    It advises to turn off 504 non reporting performance collection rules, then only turn back on the ones of interest.
    However it does not state how to identify / locate these 504 rules. I would prefer to find/disable them via PowerShell rather than manually.
    Can someone please advise how to locate these 504 rules please and disable on mass.
    Thanks
    AAnotherUser__
    AAnotherUser__

    you’ll need a script that performs the following steps:
    Retrieve the management pack in which to store the overrides
    Retrieve the class that will be targeted by the override
    Retrieve the rules or monitors that will be disabled
    Disable the rule or monitor
    To disable bulk of rule, Here is the sample that disables all rules matching the “*events/sec*” filter.
    $MP =
    Get-SCOMManagementPack -displayname
    "Exchange 2010 Overrides" |
    `
    where {$_.Sealed
    -eq $False}
    $Class =
    Get-SCOMClass -DisplayName
    "Exchange Performance rule"
    $Rule =
    Get-SCOMRule -DisplayName
    "*Events/sec"
    Disable-SCOMRule
    -Class $Class -Rule
    $Rule -ManagementPack
    $MP -Enforce
    Also, you can refer below link
    http://www.systemcentercentral.com/opsmgr-2012-disabling-rules-and-monitors-in-bulk-in-powershell/
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"

  • Exchange 2010 - Getting report on local internal email

    Hi,
    I am trying t get one particular stat out of my Exchange 2010 server using Powershell and could use some help.  I simply want the total number of emails sent internally within my single exchange server. 
    Below is the Powershell command I have tried.
    get-messagetrackinglog -ResultSize unlimited -Start “05/14/2013 00:00:00″ -End “06/10/2013 23:59:00″ | where {$_.Sender -like “*@domain.com“} | where {$_.Recipients -like “*@domain.com“} > “C:\internalmail.txt
    The internalmail.txt file is empty.  I have made a couple attempts to get this information from the messagetrackinglog, but haven't gotten any results.  I was able to get the total number of RECEIVED and SENT emails from and to external addresses,
    but nothing internal.
    Does the messagetrackinglog keep a record of internal emails within the Exchange server?
    Thanks for any help you can give.
    Terry

    Your command should work, but there's no need for a double 'where{}' and using ">file.txt" makes a not so useful file:
    get-messagetrackinglog -ResultSize unlimited -Start “06/10/2013 00:00:00" -End “06/10/2013 00:59:00" | where {$_.Sender -like “*@rotterdam.nl“ -AND $_.Recipients -like “*@rotterdam.nl“} > “C:\internalmail.txt"
    Also, you did not specify a server, so you will have to run this command on a transportserver and it will only return results from that perticular server.
    Try the following:
    get-transportserver| get-messagetrackinglog -ResultSize unlimited -Start $(get-date).addhours(-1) -End $(get-date) | where {$_.Sender -like "*@org.nl" -AND $_.Recipients -like "*@org.nl"} | select EventId,Source,Sender,@{name="Recipient";expression={[system.String]::Join(";",$_.Recipients)}},MessageSubject| export-csv -noTypeInformation "C:\internalmail.txt"
    you should be able to run it from any of you servers and it should get you the logs from all transport servers over the last hour. I've used $(get-date) here to see if it is an issue with your date format (it uses locale settings, an "issue" that
    has been fixed in Exch 2010).
    http://technet.microsoft.com/en-us/library/aa997573(v=exchg.80).aspx
    End
    Optional
    System.DateTime
    This parameter returns message tracking log entries up to, but not including, the specified End date and time byusing the regional format of the
    computer on which the cmdlet is run.
    (you can expect an error on edge server query ... ignore these)

  • Exchange 2010 SP2 RU2 - Indexing backlog reached a critical limit of 48 hours or the number of items in the retry queue is greater than 10000 for one or more databases

    We have been getting intermittent SCOM alarms for our Exchange 2010 MBX server citing "Indexing backlog reached a critical limit of 48 hours or the number of items in the retry queue is greater than 10000 for one or more databases"
    I see events in EventViewer that SCOM is triggering on, but not whats generating the events or how else to test for them.
        get-eventlog -computername SERVERNAME -logname "Application" -after "03/14/2013" | ?{$_.eventid -eq "5604"} | select MachineName,EventID,EntryType,Message | ft -autosize
    One MS Forum post online says it is a bug in RU4, unclear if it may also be a bug in RU2 (our installed version).
        http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/9dcb3011-9327-4935-9479-62b38a6ddd87
        "I was looking for the same error and found this.. it basically says that this is a bug in RU4 and RU4-v2...and it needs to be removed."
    tests using troubleshooting scripts find no issues with search indexer,
        [PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>.\Troubleshoot-CI.ps1
        Get-EventLog : No matches found
        At C:\Program Files\Microsoft\Exchange Server\V14\scripts\CITSLibrary.ps1:622 char:40
        + $msftesqlCrashes = get-eventlog <<<< -computername $Server -after $StartTime -logname "Application" -source $msftesqlServiceName | where {$_.eventId
        -eq $msftesqlCrashEventId}
            + CategoryInfo : ObjectNotFound: (:) [Get-EventLog], ArgumentException
            + FullyQualifiedErrorId : GetEventLogNoEntriesFound,Microsoft.PowerShell.Commands.GetEventLogCommand
        Name IsDeadLocked CatalogStatusArray
        SERVERNAME False {DATABASENAME\SERVERNAME, DATABASENAME\S...
        [PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>
    and tests against searches on each DB themselves show no issues and respond typically within 3 seconds.
        [PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>Test-ExchangeSearch | ft Server, Database, ServerGuid, ResultFound, SearchTimeInSeconds, Error -AutoSize
        Server Database ServerGuid ResultFound SearchTimeInSeconds Error
        SERVERNAME DATABASENAME b16e3461-257c-40dd-a9ad-99a5f41a927e True 2.937
    I also tried to check the Performance Viewer for the MSExchange Search Indexer and MXExchange Search Indices but am unsure which of the many metrics would indicate this issue.
    We have had no reports of search issues from our users and have been unable to duplicate any impairment in our testing.
    Does anyone else have any suggestions for tests to check or steps to take on this alert? Is it simply a false alarm or a timeout of other sorts during testing? We have 80 DAGs on this server (as well as all our servers, some of which have also reported the
    same alert) and the Test-ExchangeSearch command times out before completely testing all DAGs.

    Hi IAMChrisL,
    Any updates?
    Frank Wang
    TechNet Community Support

Maybe you are looking for