Search found 216 matches

by ITEngineer
Tue Jun 26, 2018 10:31 pm
Forum: PowerShell
Topic: PowerShell to parse Exchange message tracking not working ?
Replies: 13
Views: 5414

Re: PowerShell to parse Exchange message tracking not working ?

jvierra wrote: Tue Jun 26, 2018 10:24 pm Copy and paste this:

[datetime]'1/3/2018 1:00:00 AM'
The result is:
Wednesday, 3 January 2018 1:00:00 AM
by ITEngineer
Tue Jun 26, 2018 10:11 pm
Forum: PowerShell
Topic: PowerShell to parse Exchange message tracking not working ?
Replies: 13
Views: 5414

Re: PowerShell to parse Exchange message tracking not working ?

I've swapped the DD/MM/YYYY with MM/DD/YYYY, However the error message is now just like below repeated 15x as the number of my Exchange servers: The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties ...
by ITEngineer
Tue Jun 26, 2018 9:23 pm
Forum: PowerShell
Topic: PowerShell to parse Exchange message tracking not working ?
Replies: 13
Views: 5414

Re: PowerShell to parse Exchange message tracking not working ?

Thanks for the assistance in this matter, somehow it is still displaying the same issue: Cannot convert value "1/03/2018 3:00:00 PM" to type "System.DateTime". Error: "String was not recognized as a valid DateTime." At C:\Users\Admin\AppData\Local\Temp\12567d90-4897-4db...
by ITEngineer
Tue Jun 26, 2018 7:11 pm
Forum: PowerShell
Topic: PowerShell to parse Exchange message tracking not working ?
Replies: 13
Views: 5414

PowerShell to parse Exchange message tracking not working ?

Hi All, I need some help in fixing the below PowerShell script for Exchange Server message tracking log. Basically, the script is searching for all NDR (email with the subject "*Undeliverable: *" ) that is delivered within the specific time frame, in the case above is 1st March 2018 until ...
by ITEngineer
Wed Jun 06, 2018 7:55 pm
Forum: PowerShell
Topic: Exchange PowerShell Unable to export list to CSV ?
Replies: 15
Views: 5005

Re: Exchange PowerShell Unable to export list to CSV ?

That doesn't make any sense. If the output is correct then the CSV will reflect the output. You have some kind of mistake in the code and you are likely not using the exact code I posted. This would be a better way to do this: $inputFile = 'C:\trackingemail.csv' $trackparams = @{ Start = (Get-Date)...
by ITEngineer
Wed Jun 06, 2018 7:34 pm
Forum: PowerShell
Topic: Exchange PowerShell Unable to export list to CSV ?
Replies: 15
Views: 5005

Re: Exchange PowerShell Unable to export list to CSV ?

Now tell me what this produces. foreach ($email in (Import-Csv $inputFile)) { Write-host "Email address: $($email.email)" $resultFile = "C:\$($email.email).CSV" $TransportServers = Get-TransportService $TransportServers | % { Get-Messagetrackinglog -Server $_.Name @trackparams -...
by ITEngineer
Wed Jun 06, 2018 6:59 pm
Forum: PowerShell
Topic: Exchange PowerShell Unable to export list to CSV ?
Replies: 15
Views: 5005

Re: Exchange PowerShell Unable to export list to CSV ?

And what does this show you? foreach ($email in (Import-Csv $inputFile)) { Write-host "Email address: $($email.email)" $resultFile = "C:\$($email.email).CSV" $TransportServers = Get-TransportService $TransportServers | % { Get-Messagetrackinglog -Server $_.Name @trackparams -Rec...
by ITEngineer
Wed Jun 06, 2018 6:36 pm
Forum: PowerShell
Topic: Exchange PowerShell Unable to export list to CSV ?
Replies: 15
Views: 5005

Re: Exchange PowerShell Unable to export list to CSV ?

Is that what you want? Where is the data. Look like a bunch of headers to me. I only want these as the content of the each respective .CSV file: Name Count ---- ----- no-reply@email.com 123 no-reply@email2.com 93 Alert@email2.com 67 Now run this to see what you get. It works to display the result i...
by ITEngineer
Wed Jun 06, 2018 6:20 pm
Forum: PowerShell
Topic: Exchange PowerShell Unable to export list to CSV ?
Replies: 15
Views: 5005

Re: Exchange PowerShell Unable to export list to CSV ?

Now run this to see what you get. foreach ($email in (Import-Csv $inputFile)) { Write-host "Email address: $($email.email)" $TransportServers = Get-TransportService $TransportServers | % { Get-Messagetrackinglog -Server $_.Name @trackparams -Recipients $email.email | ? { $_.Sender -notmat...
by ITEngineer
Wed Jun 06, 2018 5:54 pm
Forum: PowerShell
Topic: Exchange PowerShell Unable to export list to CSV ?
Replies: 15
Views: 5005

Re: Exchange PowerShell Unable to export list to CSV ?

Then add one line at a time until you have found the issue. Time to learn how to debug a script … eh? Yes, I ahve removed the line Export-CSV $resultFile -NoTypeInformation from the original script and the result is displayed on the console. But how to export it to the respective .CSV file ? hence ...