Need to invoke functions but can't escape from loop


i need write script check mailbox every 15 seconds new mail. i've made progress thinking forwards i'm gonna want run script against multiple mailboxes. it's this:

function checkmail {  start timer start loop  get-messagetrackinglog -recipients $mailbox -eventid receive -start $start -end $end     if $mailbox (not null){         stuff         set null       }   sleep 15 seconds  } # end function  invoke function

so script calls function runs infinite loop checking mailbox every 15 seconds. want check multiple mailboxes though , thinking same thing different functions , invoke them in 1 go @ beginning first 1 stuck in it's loop. there's fact can't use array mailbox variable because want change number of seconds wait on mailboxes wouldn't constant.

any ideas how go this?
in advance


if there's going lot of mailboxes being  monitored, believe less stress on servers if use ews managed api, , subscribe new mail notification events on mailbox servers mailboxes want monitor.

[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

RDS 2012 r2 collections show black screen and then close