Thursday, October 06, 2011

Get Time Zones for your users via PowerShell

We recently released a cmdlet that bulk-inserts holidays in Exchange 2010 (see the Sumatra website or the Sumatra Blog).

A holiday is a simple all day calendaring event in Outlook. Yet simple calendaring events can be tricky! Consider: when your end users work in different time zones! If you force an all day event into one time zones, all users who are not in that time zone will see their holidays span multiple days. Not a happy scenario. What's the solution?

We wrote a script that uses Exchange 2010 "get-mailboxRegionalConfiguration" cmdlet to find the timezones. If used in conjunction with get-mailbox, you can output a file that has the user information plus the timezone. Problem solved!

This script produces a file that outputs PrimarySMTPAddress + TimeZone:
#Define your 'default' timezone (if none is set)
$myDefaultTimezone="Eastern Standard Time"

#Define the output file
$myOutputFile="userlist.txt"

#Define the list of User Accounts to process
$myMailboxList = get-mailbox -Filter {RecipientTypeDetails -eq "UserMailbox"}  select-object Identity,PrimarySMTPAddress

#If file exists, delete the file
$fileExists=test-Path $myOutputFile
if ($fileExists -eq "True"){del $myOutputFile}


#Loop through list and get
foreach ($t in $myMailboxList) {
    $priSMTP=$t.PrimarySMTPAddress
    $xi=get-mailboxRegionalConfiguration -Identity $t.Identity
    if ($xi.TimeZone -eq $Null) {$tt=$myDefaultTimezone} Else {$tt=$xi.TimeZone}
    write-output "$priSMTP $tt" >> $myOutputFile
}

write-output "Done!  see the file $myOutputFile"

You can also download getUserTimezones.zip

If you have another way, please share!

-Russ

Monday, October 03, 2011

Holiday cmdlet for Exchange 2010

We've been inserting holidays server-side on Exchange for a while and after some feedback last year we started re-thinking how to accomplish this.
These are the files in the downloadable ZIP

We've written a PowerShell cmdlet we call suHoliday that inserts holidays server-side.  We've run it through our internal testing against on-premises Exchange 2010, Live @ Edu, and Office 365, so now we think it's time to let it out into the wild and see what you folks can do with it.

The sample CSV file for US holidays

 Your inserted holidays will look like this in a user's calendar:

If you want to download it and run it through its paces in your test lab, you may do so here.  We just ask you to answer a few questions so we can keep track of where it's going.  If it works for you consider making a donation of US$20 per instance.  It'll make it easier for us to consider updates and new features for next year.

What's it do now?





  • Insert server-specific or user-specific holidays through 2012 with NO user intervention.




  • Customize for different state or national holidays.




  • Define Free/Busy status.




  • Script adding holidays at user provisioning time (e.g., by piping in from get-mailbox).




  • Support for multiple time zones.




  • Define All-Day Events or appointments at specific times.




  • Support international holidays / date formats. For example: 2012 UK Bank Holidays


  • Try it out and tell your friends.


    Limitations (or, what do you want for free / ultra low cost?)

    • This only inserts holidays for the year 2012 (well, we give you a few weeks into 2013).
    • All inserted events have "Inserted courtesy of the Exchange Calendaring experts: Sumatra Development" in the agenda. (yep, even if you license it)
    • We support via electronic means, so keep an eye on our blog.