Category Archives: PS

Exchange: Send Out of Office notices more than one time per User

when we activate the option out of office in exchange, only it allows us to send a mesage response by sender once the feature activated, sometimes it would be interesting to reset the counter of shipments (by user) to send the notice out of office again to the same sender.
An elegant solution is:

deactivate and reactivate the option of out of office by a task of powershell,

for instance:

ccreate a few scripts like this:

roof.ps1

Set-MailboxAutoReplyConfiguration mailbox1 -AutoReplyState Disabled;
Set-MailboxAutoReplyConfiguration mailbox2 -AutoReplyState Disabled;
Set-MailboxAutoReplyConfiguration mailbox3 -AutoReplyState Disabled;
....

soof.ps1:

Set-MailboxAutoReplyConfiguration mailbox1 -AutoReplyState Enabled;
Set-MailboxAutoReplyConfiguration mailbox2 -AutoReplyState Enabled;
Set-MailboxAutoReplyConfiguration mailbox3 -AutoReplyState Enabled;
....

create 2 scheduled taks (wait 1 minute one to other) to execute ,you can configure the schedule like you want, ( each day, each week , each hour,…..)
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
with the parameters for the first:
-version 2.0 -command “. ‘c:\Exchange\bin\RemoteExchange.ps1’; Connect-ExchangeServer -auto;.\roof.ps1”
with the parameters for the second:
-version 2.0 -command “. ‘c:\Exchange\bin\RemoteExchange.ps1’; Connect-ExchangeServer -auto;.\soof.ps1”

Facebooktwitterredditpinterestlinkedinmail

Read More ...

Export Exchange Audit logs

One of the most powerfull feature of Exchange logs is the possibility to audit for example all emails send from the source domain: domain.com every day and send a mail to some user, this is one sample scrit that colects information and sends a mail:

$file= "c:\prova.csv" 
$mailboxdata= Get-MessageTrackingLog -Start "10/14/2013 00:00:00"| Where-Object {$_.sender -like "*@domain.com"} | Select-Object eventid,sender,timestamp,@{Name="Recipients";Expression={$_.recipients}},@{Name="RecipientStatus";Expression={$_.recipientstatus}},messagesubject $mailboxdata | export-csv "$file" 
$smtpServer = "127.0.0.1" 
$att = new-object Net.Mail.Attachment($file) 
$msg = new-object Net.Mail.MailMessage 
$smtp = new-object Net.Mail.SmtpClient($smtpServer) 
$msg.From = "sender@domain.com" 
$msg.To.Add("dest1@domain.com") 
$msg.To.Add("dest2@domain.com")
$msg.Subject = "Emails Summary" 
$msg.Body = "Attached is the email server mailbox report" 
$msg.Attachments.Add($att) 
$smtp.Send($msg) 
$att.Dispose()
Facebooktwitterredditpinterestlinkedinmail

Read More ...

Categories

Subscribe to my Newsletter




By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close