?
Solved

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

Posted on 2015-02-11
7
Medium Priority
?
50 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Accepted Solution

by:
Guy Lidbetter earned 2000 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

762 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