Solved

Need some tips using Powershell to analysis the screen output of Exchange message logs

Posted on 2015-02-11
7
26 Views
Last Modified: 2016-06-23
I would like some tips on how to use  PowerShell to extract data, I'm using Exchange message logs as example but could apply to anything:

So I'll try explain what I'd like to do:

1. Firstly run a command like $search = Get-MessagingTrackingLog -Server xxxxxx
2. Whilst the viewing the output on screen, I like to stop at a line, and run $search [x] | fl

Any help would be appreciated and thank you in advance
0
Comment
Question by:mandalj
  • 3
  • 2
7 Comments
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 40604888
2. Whilst the viewing the output on screen, I like to stop at a line, and run $search [x] | fl

Do not really understand the second question. Please rephrase.

Will.
0
 

Author Comment

by:mandalj
ID: 40604936
Sorry, not the easiest thing to explain. I've attached a couple of screen shots, hope it helps.

Thanks.
EE-Question.docx
0
 
LVL 13

Expert Comment

by:Guy Lidbetter
ID: 40605185
OK, to follow what you are asking...

In your example you take a tracking log and put it into a variable, you would then want to be able to pick any line out of display  and format list for all details?

If that is the case, if the log had hundreds (if not thousands) of lines, half way down you would have no idea what the line number is, so you need to add those to the output for the variable array.

Am I on the right track?
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Author Comment

by:mandalj
ID: 40605373
Yes, you are.
0
 
LVL 13

Accepted Solution

by:
Guy Lidbetter earned 500 total points
ID: 40607588
Hi Mandalj,

So I've been playing with this and needs a little more work, but this is where I am so far...

To insert the line number run the below which will update the $Search Array

"
[decimal]$LineNumber = 0
$Search = Get-TransportServer | Get-MessageTrackingLog -start "11/02/2015 09:00:00" -End "11/02/2015 09:05:00"
ForEach ($Line in $Search) {
    $Line | Add-Member -Name "Line" -Type NoteProperty -Value $LineNumber
    $LineNumber ++
    }
"

If you then run a select with the initial columns you would like to see, i.e.

$Search | Format-Table -Autosize Line, EvenID, Source, Sender, Recipients | More

You can go a page at a time, break (CTRL +C), then run

$Search[x] | FL

For all the details.

Not glamorous... but it works

Cheers

Guy
0
 

Author Comment

by:mandalj
ID: 40610308
Thanks Guy...I'll try this out.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Find out what you should include to make the best professional email signature for your organization.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question