本帖最後由 wongcc2006 於 2017-11-1 01:39 編輯
本身有個SCRIPT去GET MESSAGE TRACE (O365)
而家有DD低能
想問問有無可能USER INPUT想睇幾個個PAGE (X) ,然後自動RUN相對次數 (-PAGE X)
之後export-csv trace(X).csv- write-host "getting trace (pass 1 of 10)"
- Get-MessageTrace -Page 1 -PageSize 5000 |select Received, SenderAddress, RecipientAddress, Subject, Status, Index| Export-Csv trace1.csv -NoTypeInformation -Encoding UTF8
- write-host "getting trace (pass 2 of 10)"
- Get-MessageTrace -Page 2 -PageSize 5000 |select Received, SenderAddress, RecipientAddress, Subject, Status, Index| Export-Csv trace2.csv -NoTypeInformation -Encoding UTF8
- write-host "getting trace (pass 3 of 10)"
- Get-MessageTrace -Page 3 -PageSize 5000 |select Received, SenderAddress, RecipientAddress, Subject, Status, Index| Export-Csv trace3.csv -NoTypeInformation -Encoding UTF8
- write-host "getting trace (pass 4 of 10)"
- Get-MessageTrace -Page 4 -PageSize 5000 |select Received, SenderAddress, RecipientAddress, Subject, Status, Index| Export-Csv trace4.csv -NoTypeInformation -Encoding UTF8
- write-host "getting trace (pass 5 of 10)"
- Get-MessageTrace -Page 5 -PageSize 5000 |select Received, SenderAddress, RecipientAddress, Subject, Status, Index| Export-Csv trace5.csv -NoTypeInformation -Encoding UTF8
複製代碼 |