Announcement

Collapse
No announcement yet.

Help with PS Script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with PS Script

    Hi,

    I'm trying to use powershell to create a CSV file that outputs email stats for any given sender. I can get a list of the emails sent by the user, but the recipient column is empty. This is a command i've used that just gives me a list of recipient email addresses:

    get-messagetrackinglog -Sender="[email protected]" -Start "29/07/2008 08:00:00" -End "29/07/2008 14:00:00: | select-object @{Name="Recipient";Expression={$_.recipients}} | export-csv c:\exch\7.csv

    Does anybody know what the command is to also add the sender name, recipient address and timestamp? I'm going to carry on experimenting and will report back if i get the results i need.

    Thanks for your help,
    Matt
    Last edited by Stingray_Matt; 30th July 2008, 15:54.

  • #2
    Re: Help with PS Script

    Run below command on hubcas server to get Recipients in CSV file.



    get-messagetrackinglog -sender "[email protected]" -start "07/31/08 02:00 pm" | select Timestamp, ServerHostname, Source, EventId, {$_.Recipients}, {$_.RecipientStatus}, TotalBytes, RecipientCount, RelatedRecipientAddress, MessageSubject, Sender | export-csv c:\test.csv

    Please do necessary changes before | select
    Last edited by reddlotus; 1st August 2008, 08:47.
    MCITP - MCTS - MCSE

    Comment


    • #3
      Re: Help with PS Script

      That has worked like a charm. Thanks for your help.

      Comment


      • #4
        Re: Help with PS Script

        Don't forget the reputation button
        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment

        Working...
        X