MM&M UG UK

 

The home of the Microsoft Messaging and Mobility

User Group in the UK.

Welcome to MM&M UG UK Sign in | Join | Help
in
Home Blogs Forums Photos Articles Links CESN Downloads Aggregated RSS

get-messagetrackinglog and pipe it to CSV

Last post 09-19-2008, 7:26 by nathanwinters. 10 replies.
Sort Posts: Previous Next
  •  07-13-2007, 2:10 1360

    get-messagetrackinglog and pipe it to CSV

    I have asked this question on several Exchange 2007 and Powershell fora, but I have yet to get an answer / solution.

    I have been trying to get powershell to make me a CSV file with all entries in the messagetrackinglog of the type FAIL. But I am having some problems with the two of the variables - Recipients and SenderRecipients.

    The commandline I am trying to run is this:

    get-messagetrackinglog -EventID "FAIL" -Start "07-07-2007 00:00:00" -End "07-07-2007 23:59:00" -ResultSize 4 | Select-Object Recipients, SenderRecipients, RecipientStatus, ServerIp,Sender, MessageId | export-csv c:\test.csv

    And the file I get from this is this:

    #TYPE System.Management.Automation.PSCustomObject
    Recipients,SenderRecipients,RecipientStatus,ServerIp,Sender,MessageId
    System.String[],,System.String[],,henrik@kanonerbjudande.se,<419779-22007745104938156@mailsenderclass>
    System.String[],,System.String[],,henrik@kanonerbjudande.se,<4133288-22007745151252296@mailsenderclass>
    System.String[],,System.String[],,fyb@zianet.com,<468E8C31.6060202@zianet.com>
    System.String[],,System.String[],216.234.192.171,postmaster@mailsender.biz,<75f85890-ac52-44db-b585-133bc37e3618>

    As you can see, Recipients and SenderRecipients are of an array type, and does not give me the content.

    My question is therefore, how can I get the information in the two arrays? If this is not the right forum to ask for help with powershell, I apologize, and hope someone can point me to a more suitable forum to seek help.

    Eventually I want this command/script to run daily via a scheduled job somehow. I gather that I need to make a ps1 script that can be run by windows. If the above command needs to be altered to make this possible, I would also very much like to get input on this :)

    Hope someone can help.
  •  08-23-2007, 14:17 1434 in reply to 1360

    Re: get-messagetrackinglog and pipe it to CSV

    Hi,

    Sorry for the delay on this reply.

    Regards an answer I am not sure, but wonder how you have got on with this one.

    If you are not getting anywhere still, then let me know and I will try and past this on to some MS people who may be able to help.

    Hope to hear back

    Cheers

    Nathan

     


    Nathan Winters - MVP Exchange Server
    MCSE & MCSA 2000 & 2003 + Messaging, MCITP Exchange 2007, MCP, VMWare VCP v2 & v3.

    Welcome to the Microsoft Messaging and Mobility User Group: http://www.mmmug.co.uk
  •  11-27-2007, 8:43 1732 in reply to 1360

    Re: get-messagetrackinglog and pipe it to CSV

    Alas, I too have encountered this problem, and would be greatful if anyone has figured out a solution.

    Thanks.

     

     

  •  11-30-2007, 6:46 1761 in reply to 1732

    Re: get-messagetrackinglog and pipe it to CSV

    Hi,

     

    I'm affraid I never found or got an answer to this one.

    I hope someone else might be able to help

    Cheers

    Nathan


    Nathan Winters - MVP Exchange Server
    MCSE & MCSA 2000 & 2003 + Messaging, MCITP Exchange 2007, MCP, VMWare VCP v2 & v3.

    Welcome to the Microsoft Messaging and Mobility User Group: http://www.mmmug.co.uk
  •  12-24-2007, 0:55 1889 in reply to 1761

    Re: get-messagetrackinglog and pipe it to CSV

    I found this post through google and I thought I would post my findings.
    It seems the output cmdlet doesn't work 100% so it at present can't accept the details passed through to it, so it outputs the variables.
    The best work-a-rounds I have found is to either pipe to Format-list which gives the full headers,
    so:
    Get-MessageTrackingLog -Start "03/13/2006 9:00AM" -End "03/15/2006 5:00PM" -Sender "tbremer@contoso.com" | Format-List
    or Double piping to format-table then to clip (which puts it on the clip-board to paste into excel etc)
    Get-MessageTrackingLog -Start "03/13/2006 9:00AM" -End "03/15/2006 5:00PM" -Sender "tbremer@contoso.com" | Format-Table -wrap |clip

  •  12-24-2007, 3:18 1891 in reply to 1889

    Re: get-messagetrackinglog and pipe it to CSV

    Hi,

    That is interesting!

    So are you saying there is actually a bug in this area?

    If you could outline exactly what occurs (i.e. how to reproduce the output issue) then I will escalate that into MS and see whether they know about the issue.

    Cheers

    Nathan

     


    Nathan Winters - MVP Exchange Server
    MCSE & MCSA 2000 & 2003 + Messaging, MCITP Exchange 2007, MCP, VMWare VCP v2 & v3.

    Welcome to the Microsoft Messaging and Mobility User Group: http://www.mmmug.co.uk
  •  01-25-2008, 18:54 1987 in reply to 1891

    Re: get-messagetrackinglog and pipe it to CSV

    Hey Nathan, the bug can be reproduced the same way SuneR did it. But it isn't a major bug just something in one of the cmdlets is screwed.
  •  01-27-2008, 14:57 1989 in reply to 1987

    Re: get-messagetrackinglog and pipe it to CSV

    Hi,

    Thanks for clarifying that.

    I will flag it to MS and see what they come up with.

    Cheers

    Nathan


    Nathan Winters - MVP Exchange Server
    MCSE & MCSA 2000 & 2003 + Messaging, MCITP Exchange 2007, MCP, VMWare VCP v2 & v3.

    Welcome to the Microsoft Messaging and Mobility User Group: http://www.mmmug.co.uk
  •  01-27-2008, 17:48 1991 in reply to 1989

    Re: get-messagetrackinglog and pipe it to CSV

    Right, maybe a possible answer

    Take a look in the help as follows

    “help select-object –det”

     

    Take a look at “-expandproperty”. So….

     

    Select-Object Recipients, SenderRecipients, RecipientStatus, ServerIp,Sender, MessageId –expandproperty Recipents....

     

    Let me know how you get on.

    Cheers

    Nathan

     


    Nathan Winters - MVP Exchange Server
    MCSE & MCSA 2000 & 2003 + Messaging, MCITP Exchange 2007, MCP, VMWare VCP v2 & v3.

    Welcome to the Microsoft Messaging and Mobility User Group: http://www.mmmug.co.uk
  •  09-11-2008, 8:13 23456 in reply to 1991

    Re: get-messagetrackinglog and pipe it to CSV

    The solution for this is
    select-Object SenderRecipients, RecipientStatus, ServerIp,Sender, MessageId,{$_.recipients}
    might be got before but only to help out those who make a visit to this page!!!!
  •  09-19-2008, 7:26 23932 in reply to 23456

    Re: get-messagetrackinglog and pipe it to CSV

    Hi,

    Thanks, it is nice when people follow up!

    Cheers

    Nathan


    Nathan Winters - MVP Exchange Server
    MCSE & MCSA 2000 & 2003 + Messaging, MCITP Exchange 2007, MCP, VMWare VCP v2 & v3.

    Welcome to the Microsoft Messaging and Mobility User Group: http://www.mmmug.co.uk
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems