REPORT EXCH 2007
Hello, I am using 2 ps1 files to track accepted domains that we do not use that often. I wish to run maybe only on ps1 file with the same "nice" view (readable on one row) but be able to distinguish each accepted domains by date and run that track in depth everyday as I wanna have a good view of those accepted domains trafic. E.G: I wish to extract {$_.Sender -like "*@accepteddomain1.com"} as accepteddomain1com_11022011.csv everday (When I run that ps1 file it deletes the existing file. I wish to be able to know whenthe track has run. file.PS1 $start=(get-date).adddays(-7).toshortdatestring() $end=(get-date).toshortdatestring() get-messagetrackinglog -resultsize unlimited -Start $start -End $end | where {$_.Sender -like "*@accepteddomain1.com"} | ft MessageSubject,Recipients,Sender | out-file D:\Report\AcceptedDomain\SENTTO\accepteddomain1com.csv -enc ASCII -width 1500 get-messagetrackinglog -resultsize unlimited -Start $start -End $end | where {$_.Sender -like "*@accepteddomain2"} | ft MessageSubject,Recipients,Sender | out-file D:\Report\AcceptedDomain\SENTTO\teamloges.csv -enc ASCII -width 1500 get-messagetrackinglog -resultsize unlimited -Start $start -End $end | where {$_.Sender -like "*@accepteddomain3"} | ft MessageSubject,Recipients,Sender | out-file D:\Report\AcceptedDomain\SENTTO\open-itfr.csv -enc ASCII -width 1500 get-messagetrackinglog -resultsize unlimited -Start $start -End $end | where {$_.Sender -like "*@accepteddomain4"} | ft MessageSubject,Recipients,Sender | out-file D:\Report\AcceptedDomain\SENTTO\openintra.csv -enc ASCII -width 1500 file2.ps1 $start=(get-date).adddays(-7).toshortdatestring() $end=(get-date).toshortdatestring() get-messagetrackinglog -resultsize unlimited -Start $start -End $end | where {$_.Recipients -like "*@accepteddomain1.com"} | ft MessageSubject,Recipients,Sender | out-file D:\Report\AcceptedDomain\RECEIVEDAT\accepteddomain1.csv -enc ASCII -width 1500 get-messagetrackinglog -resultsize unlimited -Start $start -End $end | where {$_.Recipients -like "*@accepteddomain2"} | ft MessageSubject,Recipients,Sender | out-file D:\Report\AcceptedDomain\RECEIVEDAT\teamloges.csv -enc ASCII -width 1500 get-messagetrackinglog -resultsize unlimited -Start $start -End $end | where {$_.Recipients -like "*@accepteddomain3"} | ft MessageSubject,Recipients,Sender | out-file D:\Report\AcceptedDomain\RECEIVEDAT\open-it.csv -enc ASCII -width 1500 I hpe I have been clear enough, if not fo not hesitate to ask for more details. Thanks, Graig
February 11th, 2011 8:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics