SomaFM commercial free internet radio All posts tagged 'email'

Paul Sturm

My notebook of discovered facts

How to install a personal certificate (for email signing) on Windows Mobile 6.1

I wanted to be able to sign/encrypt email on my BlackJack II which is running Windows Mobile 6.1.  I already have the certficates installed in Outlook for the coming year and now I wanted it on my device.

  • Export from Outlook
  • Import certs on WM6.1
    • Restart your phone first
    • Start > All Programs > Applications > File Explorer > Browse to your saved certificates
    • Select your certificate
    • Enter password that was used to export > Done
    • Hopefully, you'll get: "One ore more certificates were installed successfully"
  • View certificates

 


Permalink | Comments (0) | Post RSSRSS comment feed

Remove files based on age in days and email success message in Powershell

I have to cleanup a server share daily.  The following powershell script will remove old files and email a note to me telling me it ran.

#
# setup variables 
#
$ageInDays = 7
$fileShare = "\\server\share\subfolder"
#
# cleanout $fileShare and leave
#
$ageInDays worth of recent files
#
Get-ChildItem $fileShare -Recurse | where {$_.LastWriteTime -le (Get-Date).AddDays(-$ageInDays)} | Remove-Item -recurse
#
# setup to mail the results 
#
$SmtpClient = new-object system.net.mail.smtpClient
$SmtpServer = "smtp.domain.com"$SmtpClient.host = $SmtpServer 
$From = new-object System.Net.Mail.MailAddress("scheduledtask@domain.com", "Schedule Task")
$To = "me@domain.com"
$Title = "Snapshot cleanup run"
$Body = "The powershell snapshot cleanup of $fileShare successfully ran.
   This left $ageInDays days of snapshots. Script location is '\\server\share\cleanup_snapshots.ps1'" 
#
# mail the results 
#
$SmtpClient.Send($from,$to,$title,$Body) 

I need to get it to mail on failure, but I've not gotten that far.


Permalink | Comments (8) | Post RSSRSS comment feed