Mandy_
asked on
Powershell MailTracking search fix time (-4) hours
Get-MessageTrackingLog -ResultSize Unlimited -Start (03/05/2013 14:00:00).AddHours(-4) | Where-Object {$_.recipients -like *@gmx*}
This code above not working as i like searching for a fix time minus x_hours
Also there's sth wrong with the wildcard behind
{$_.recipients -like '*@gmx*'}
ASKER
$now = [DateTime] "03/05/2013 14:00:00"
$Date =$Now.Adhours(-4)
no working............
Method invocation failed because [System.DateTime] doesn't contain a method named 'Adhours'.
$Date =$Now.Adhours(-4)
no working............
Method invocation failed because [System.DateTime] doesn't contain a method named 'Adhours'.
Rajkumar mean:
$now = [DateTime] "03/05/2013 14:00:00"
$Date =$Now.Addhours(-4)
$now = [DateTime] "03/05/2013 14:00:00"
$Date =$Now.Addhours(-4)
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Define the date prior to running the shell command as below
$now = [DateTime] "03/05/2013 14:00:00"
$Date =$Now.Adhours(-4)
Get-MessageTrackingLog -Start $date .........