Retrieving a list of Mailbox Sizes in Exchange 2007

March 10, 2009 11:17 by dana

Prior to Exchange 2007, one of the commonly used features was the ability to view a list of all mailboxes along with their size and the number of items in the mailbox. This functionality has been removed from the Management Console in Exchange 2007. Not to fear, though, all is not lost. The following command shell script can be used to retrieve a list of all mailboxes on a server along with the mailbox size and the number of items.

Get-MailboxStatistics –Server <server name> | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount

Replace <server name> with the name of the Exchange 2007 server to query.


Sending HTML Email Using SQL Server Integration Services

March 3, 2009 17:33 by dana

SQL Server Integration Services offers an easy way to send email in your packages, but out-of-the-box it only supports sending plain text email. Below is a script that can be used to send HTML email.

 

    '// Example :
    '// SendMail("recipient@theiremail.com, _
    '//          alerts@mycompany.ca, _
    '//          "I can now send HTML Email :)", _
    '//          "<B>Yipee!</B> I can send email messages using HTML formatting from SSIS.", _
    '//          True)
    Private Sub SendMail( _
          ByVal SendTo As String, _
          ByVal From As String, _
          ByVal Subject As String, _
          ByVal Body As String, _
          Optional ByVal IsBodyHtml As Boolean = True, _
          Optional ByVal SMTPServer As String = "localhost", _
          Optional ByVal UserName As String = "", _
          Optional ByVal Password As String = "", _
          Optional ByVal Domain As String = "", _
          Optional ByVal Attachments As String = "")

        Dim oMessage As System.Net.Mail.MailMessage
        Dim mySmtpClient As System.Net.Mail.SmtpClient

        oMessage = New System.Net.Mail.MailMessage(From, SendTo, Subject, Body)
        oMessage.IsBodyHtml = IsBodyHtml
        '//Attachments
        If Not String.IsNullOrEmpty(Attachments) Then
            Dim sFiles() As String
            Dim sFile As String
            sFiles = Split(Attachments, ";")
            For Each sFile In sFiles
                If Not String.IsNullOrEmpty(sFile) Then
                    oMessage.Attachments.Add(New Net.Mail.Attachment(sFile))
                End If
            Next
        End If

        mySmtpClient = New System.Net.Mail.SmtpClient(SMTPServer, 25)
        If UserName = "" Then
            mySmtpClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
        Else
            mySmtpClient.Credentials = New System.Net.NetworkCredential(UserName, Password, Domain)
        End If
        mySmtpClient.Send(oMessage)
    End Sub

Proud to be Canadian...(usually)

February 18, 2009 22:59 by dana

Ok, I admit that I like statistics. Numbers are interesting to me. Take the number 4 for instance...ok, nevermind. What I really want to talk about is the Google Zeitgeist from 2008, especially as it relates to Canada. For the uninitiated, Google Zeitgeist is a collection of information that Google makes available regarding what is popular according to search trends. Shown below is a list of the top 10 most popular searches made by Canadians in 2008.

Most Popular

  1. facebook
  2. youtube
  3. lyrics
  4. weather
  5. games
  6. google
  7. hotmail
  8. yahoo
  9. map
  10. canada

Source: http://www.google.com/intl/en/press/zeitgeist2008/#top

Interesting, eh? I'm actually quite fearful of what this tells us about ourselves! Can it be that there are that many Canadians that still need to SEARCH for facebook? How about Google...there are a whole lot of people out there using Google to search for Google. Sigh... Some may find that depressing, I call it job security. :)