Move (or rename) a mailbox’s system folders with WebDAV

By Scott, December 12, 2005 11:36 AM

For some time, my Junk E-mail folder has been under the Journal folder.  I have no idea how I moved it there or when, especially since the Junk E-[M]ail Folder (JMF) is a system folder and thus can’t be renamed or moved through conventional means in Outlook and OWA.  I had tried several Outlook startup switches (like /resetfolders) to no avail.  I gave up long ago, but today a request came in from a user who somehow had done the same thing.  So I took another stab at finding a solution.

I happened to be messing around with WebDAV as a means of displaying a group schedule.  (Still haven’t found a way to do that.  If anyone knows of a way to create a shortcut directly to a group schedule item, which itself is a hidden appoinment item in a mailbox or public folder calendar, let me know.  An Outlook shortcut would be best, but I will take an OWA link, too.)

Long story short, you can use WebDAV to manipulate system folders with ease.  I use an excellent freeware tool called Mistaya to browse all WebDAV properties of any item/folder in Exchange.  Among the plethora of properties, the href property is the URL to the folder/item in question.  Take that URL and plug it into the Exchange SDK’s “WebDAV Sample Application” Source URL field.  Paste it into the Destination URL field, too, but modify the URL so the location is where you want.  In my case, it meant change the relative URL from /Journal/Junk%20E-mail to just /Junk%20E-mail.  Then click the Move Resource button.  If successful, the status field will display code 201.

Determining movies that are appropriate for your children

By Scott, November 29, 2005 1:21 PM

A coworker of mine and I were discussing today movies that are appropriate, and more importantly not appropriate, for our children.  He had referred me to a website before (Kids-in-mind) that reviews movies and applies a three-pronged rating to them.  Each prong represents a category: sex & nudity, violence & gore, and profanity.  It also gives scene-by-scene details of why a particular movie is receiving a given rating in a category.  This allows you, as the parent, to decide if a profanity rating of 4 is too high by reading what specifics led to the rating, rather than just arbitrarily restricting your child from any movie higher than a 3-4-2 (for example).  They review all new movies, not just ones targeted at children, so it is a good site for your teenagers, not just the toddlers that I currently have.

New CDs in response to Passion’s & Chris Tomlin’s Indescribable Tour

By Scott, November 21, 2005 1:49 PM

The tour came to Salem for its penultimate stop on the Passion Conferences Six Steps Records tour.  It included music from Chris Tomlin, Matt Redman, and a presentation by Louis Giglio.  Wow, Louis is an excellent speaker and his presentation was very awe inspiring.  After listening to Chris and Matt sing, and anyone who listens to CCM has no doubt heard songs written or sung by both of them, I had to get some CDs.  So I picked up Chris’ Arriving, Matt’s Blessed Be Your Name, and Passion’s How Great Is Our God.

I was expecting to enjoy Matt’s album more since I am more of a fan of his music versus Chris’, but I was surprised to “hear” how much I liked the album.  One of the reasons I got it is because it contains my favorite CCM song of all, How Great Is Our God.  The rest of the album is excellent, so I recommend it. 

I was not as impressed with Matt’s album, notably because it contains only live music.  I am a fan of studio recordings first, and then only live recordings if I like the song in the first place.  The album still has some really good songs, notably Blessed Be Your Name and Undignified, the latter which I could play over and over.  But I think I will have to get his albums that have studio recordings of these to really appreciate the songs. 

The same applies to the Passion CD; live music from the Passion ‘05 tour.  It’s a good album if it has a bunch of songs you want all together on one CD, but otherwise I recommend picking up the individual artists’ CDs.

Taking Christmas lights to a whole new level

By Scott, November 20, 2005 2:33 PM

My wife and friends say I go too far (though not quite Chevy Chase too far) simply because I have an inflatable penguin in my front yard, a couple lighted reindeer that always get, uh, “rearranged” by neighborhood teens every year, and lights around the house.  I think it’s the fact that they are connected individually to X10 that pushes me into geek territory.  But I am put to shame with this find, courtesy of Engadget.  It is a fuzzy home video of Deerfield Township, Ohio resident Carson Williams’ Christmas lights synchronized to “Wizards of Winter” by Trans-Siberian Orchestra.  You can download it directly from the link Engadget has on their site, but I have also embedded it:

Holiday Lights Video


Site outage because of my own carelessness

By Scott, November 15, 2005 10:45 AM

I apologize for the site outage that occured the last couple of days.  I think it was caused when I was trying to test a site searching tool.  It involved registering DLLs and granting permissions, etc.  But somehwere along the way I broke the site.  And my attempts to fix it only made it worse.  After spending hours and hours trolling the Net via Google to try and fix it, I resorted to help from the source:  Microsoft.  It took a couple of hours, but we were able to track down the permissions that were incorrect.  So everything appears to be back online, but I think I will have to visit all the pages to be sure.

Debunking the urban legend of the Mensa Invitational

By Scott, October 25, 2005 3:03 PM

Today, a coworker sent me an email purportedly containing the 2005 winners of the Mensa Invitational, sponsored by The Washington Post.  Being an email administrator, I despise chain letters (though I am a fan of Wired Magazine’s article that traces the history of the oldest email chain letter), joke emails, etc.  But this one did make me smile.  Researching its true origins, however, revealed that not only is this not from 2005, but it is practically urban legend worthy.  First, the text of the email:

The Mensa Invitational once again asked members to take any word from the dictionary, alter it by adding, subtracting, or changing one letter, and supply a new definition. Here are this year’s {2005} winners:

  1. Intaxication: Euphoria at getting a tax refund, which lasts until you realize it was your money to start with
  2. Reintarnation: Coming back to life as a hillbilly.
  3. Bozone (n.): The substance surrounding stupid people that stops bright ideas from penetrating.
  4. Foreploy: Any misrepresentation about yourself for the purpose of getting laid.
  5. Cashtration (n.): The act of buying a house, which renders the subject financially impotent for an indefinite period.
  6. Giraffiti: Vandalism spray-painted very, very high.
  7. Sarchasm: The gulf between the author of sarcastic wit and the person who doesn’t get it.
  8. Inoculatte: To take coffee intravenously when you are running late.
  9. Hipatitis: Terminal coolness
  10. Osteopornosis: A degenerate disease. (This one got extra credit.)
  11. Karmageddon: It’s like, when everybody is sending off all these really bad vibes, right? And then, like, the Earth explodes and it’s like, a serious bummer.
  12. Decafalon (n.): The grueling event of getting through the day consuming only things that are good for you.
  13. Glibido: All talk and no action.
  14. Dopeler effect: The tendency of stupid ideas to seem smarter when they come at you rapidly.
  15. Arachnoleptic fit (n.): The frantic dance performed just after you’ve accidentally walked through a spider web.
  16. Beelzebug (n.): Satan in the form of a mosquito, that gets into your bedroom at three in the morning and cannot be cast out.
  17. Caterpallor (n.): The color you turn after finding half a worm in the fruit you’re eating.
  18. Ignoranus: A person who’s both stupid and an asshole.

If you Google any of the terms you will find lots and lots (and lots) of blogs that have posted this as if it were legitimate.  But you can’t find anything on washingtonpost.com.  Well, almost.  There is an archived page on the site for their Style Invitational, which is a weekly column in the Style/Living section.  The page is for Week 281 (08/02/98), but at the bottom it lists entries from Week 278 (07/12/98), containing the very words in question.  If you manually change the URL to use the July 12 date, you get a 404.  I even tried the Wayback Machine, but the Post site isn’t indexed.  So it looks like we’re stuck with only a fragment of the original post.

In any case, the email isn’t real, but the humor remains just as funny.  Thanks to pushback.com, who blogged about this over a year ago.

A little early for Christmas, but I picked up MercyMe’s new album

By Scott, October 24, 2005 9:21 AM

The Christmas Sessions was released on September 27.  I ordered it in early October, shipping via media mail.  Wow.  That is like shipping via mule.  I think it took two weeks to arrive.  I don’t recommend it unless you really are in no hurry to get your item.  Upon first listening, I was a bit disenchanted like I was with Hymned since the songs aren’t originals by MercyMe.  Track 1 is a little too heavy for my taste, at least for Christmas music.  But after listening to the entire album again I warmed up to it.  What makes it more enjoyable each time are the arrangements.  My favorite track, Silent Night, has such a MercyMe sound to it that it points out to me how much I enjoy their musical style and Bart’s arranging and voice.

Query for a mailbox’s size and quota

By Scott, October 5, 2005 8:43 AM

There are a lot of scripts out there to report a mailbox’s current size and others to report the quota for a mailbox.  And some might even do both, but for an entire domain, server, etc.  I wanted one that I could use to list a single mailbox’s current size and where it falls within its quota.

This script allows you to find a user based on login name (samAccountName) or email address.  If multiple matches are found it will report on all of them.  It uses WMI to query Exchange for the mailbox’s current size and then uses LDAP to determine the quota.  Since there are multiple places a quota can be set (system policy, server, mailbox), the script factors those in and backtracks to the resulting quota in effect.

The results are output to the screen and to a popup window.  And since it is nice to know, it also will display if default or custom limits are in use.  This script is nice because you don’t have to customize anything.  Just download\copy it and run it.

Option Explicit
Dim objGC, objOU, strADPath
Dim strUserLoginName
Dim objADOCnxn, objADOCmd, strSearchFilter, strReturnAttrib, strSearchDepth, objResults, intMatchingRecords
Dim strUserDisplayName, strRawExchServer, strExchServer
Dim wmiConn, strWQL, wmiColl, wmiObj
Dim mbstore, strquota, stroverquota, strHardLimit, strmbsize, strquotasum

'
' Messages to be displayed if the scripting host is not cscript
'
Const kMessage1 = "Please run this script using CScript."
Const kMessage2 = "This can be achieved by"
Const kMessage3 = "1. Using ""CScript script.vbs arguments"" or"
Const kMessage4 = "2. Changing the default Windows Scripting Host to CScript"
Const kMessage5 = "   using ""CScript //H:CScript //S"" and running the script "
Const kMessage6 = "   ""script.vbs arguments""."

' Make sure running with CScript
If Not IsHostCscript() Then
	Call WScript.echo(kMessage1 & vbCRLF & kMessage2 & vbCRLF & _
         kMessage3 & vbCRLF & kMessage4 & vbCRLF & _
         kMessage5 & vbCRLF & kMessage6 & vbCRLF)
	WScript.quit
End If

' Connect to a global catalog for the forest
Set objGC = GetObject("GC:")
For Each objOU In objGC
	strADPath = "<" & objOU.AdsPath & ">"
Next
Set objOU = Nothing
Set objGC = Nothing

WScript.Echo "* Searching within: " & strADPath

' Get input - strUserLoginName
strUserLoginName = InputBox("This will search for the user's mailbox and display its size." & _
 vbCrLf & vbCrLf & "Enter a user's login name, or" & vbCrLf & "their primary SMTP address:" & _
 vbCrLf & vbCrLf & "(LDAP wildcard characters are supported.)")
If strUserLoginName = "" Then
	WScript.Echo "User Canceled"
	WScript.Quit
End If
' Use ADO to query on the given user login name
Set objADOCnxn = CreateObject("ADODB.Connection")
objADOCnxn.Provider = "ADsDSOObject"
objADOCnxn.Open "Active Directory Provider"
Set objADOCmd = CreateObject("ADODB.Command")
objADOCmd.ActiveConnection = objADOCnxn
strSearchFilter ="(&(objectCategory=person)(|(mail=" & strUserLoginName & ")(samAccountName=" & strUserLoginName & ")))"
strReturnAttrib = "displayName,msExchHomeServerName,samAccountName,mdbUseDefaults,homemdb,mDBStorageQuota,mDBOverQuotaLimit,mDBOverHardQuotaLimit"
strSearchDepth = "SubTree"
objADOCmd.CommandText = strADPath & ";" & strSearchFilter & ";" & strReturnAttrib & ";" & strSearchDepth
Set objResults = objADOCmd.Execute
intMatchingRecords = objResults.RecordCount
WScript.Echo "    AD Search Returned " & intMatchingRecords & " Records" & vbCrLf
If intMatchingRecords < 1 Then
	' User name was not found
	MsgBox "The specified string was not found!" & vbCrLf & vbCrLf & "No matching user name or SMTP address(es)", 0, "Search Results"
Else
	' We found a match, for each record in result set...
	Do
		strUserDisplayName = objResults.Fields("displayName").value
		strRawExchServer = objResults.Fields("msExchHomeServerName").value

		' only proceed if the msExchHomeServerName attribute contains an '=' character
		If InStr(1, strRawExchServer, "=", vbTextCompare) Then
		' Parse out the actual Exchange server name (everything to right of last '=')
		strExchServer = Mid(strRawExchServer,InStrRev(strRawExchServer, "=", -1, vbTextCompare) + 1)

		' Create a WMI connection to that server
		Set wmiConn = GetObject("WinMgmts:{impersonationLevel=impersonate}!\\" & strExchServer & "\root\microsoftexchangev2")

		' Search for the display name of the user
		WScript.Echo "* Looking for '" & strUserDisplayName & "' on server " & strExchServer
		strWQL = "SELECT * FROM Exchange_Mailbox WHERE MailboxDisplayName = '" & strUserDisplayName & "'"
		'WScript.Echo "    DEBUG " & strWQL
		WScript.Echo "  Searching... Please wait"

		Set wmiColl = wmiConn.ExecQuery(strWQL)
		If wmiColl.Count >= 1 Then

			' Get quota limits
			If objResults.Fields("mDBUseDefaults").value = true Then
				Set mbstore = GetObject("GC://" & objResults.Fields("homemdb"))
				If mbstore.mDBStorageQuota = "" Then
					strquota =  "No Quota"
				Else
					strquota = formatnumber(mbstore.mDBStorageQuota/1024,0)
				End if
				If mbstore.mDBOverQuotaLimit = "" Then
					stroverquota =  "No Quota"
				Else
					stroverquota = formatnumber(mbstore.mDBOverQuotaLimit/1024,0)
				End if
				If mbstore.mDBOverHardQuotaLimit = "" Then
					strHardLimit =  "No Quota"
				Else
					strHardLimit = formatnumber(mbstore.mDBOverHardQuotaLimit/1024,0)
				End if
				If strquota <> "No Quota" Then
					strquotasum = "    Storage Quotas (Using store limits):" & vbcrlf
					strquotasum = strquotasum & "    Warning Limit: " & strquota & " MB" & vbcrlf
					strquotasum = strquotasum & "    Prohibit Send: " & stroverquota & " MB" & vbcrlf
					strquotasum = strquotasum & "    Prohibit Receive: " & strHardLimit & " MB" & vbcrlf
				Else
					strquotasum = "Storage Limits: No Quotas Configured" & vbcrlf
				End if
			Else
				If IsNull(objResults.fields("mDBStorageQuota").value) Then
					strquota =  "No Quota"
				Else
					strquota = formatnumber(objResults.fields("mDBStorageQuota").value/1024,0) & " MB"
				End if
				If IsNull(objResults.fields("mDBOverQuotaLimit").value) Then
					stroverquota =  "No Quota"
				Else
					stroverquota = formatnumber(objResults.fields("mDBOverQuotaLimit").value/1024,0) & " MB"
				End if
				If IsNull(objResults.fields("mDBOverHardQuotaLimit").value) Then
					strHardLimit =  "No Quota"
				Else
					strHardLimit = formatnumber(objResults.fields("mDBOverHardQuotaLimit").value/1024,0) & " MB"
				End if
				strquotasum = "    Storage Quotas (Using custom limits):" & vbcrlf
				strquotasum = strquotasum & "    Warning Limit: " & strquota & vbcrlf
				strquotasum = strquotasum & "    Prohibit Send: " & stroverquota & vbcrlf
				strquotasum = strquotasum & "    Prohibit Receive: " & strHardLimit & vbcrlf

			End if

			' for each mailbox found (should only be one), display the size
			For Each wmiObj In wmiColl
				WScript.Echo "    Found: " & wmiObj.MailboxDisplayName
				WScript.Echo "    Mailbox Size: " & formatnumber(wmiObj.Size/1024,1) & " MB" & vbCrLf
				Wscript.Echo strquotasum
				MsgBox "    Mailbox: " & strUserDisplayName & vbcrlf & "    Size: " & formatnumber(wmiObj.Size/1024,1) & _
				 " MB" & vbcrlf & vbcrlf & strquotasum, 0, "Search Results"
			Next
		Else
			' No mailbox found
			MsgBox "'" & strUserDisplayName & "' mailbox was not found on server " & strExchServer, 0, "Search Results"
		End If

		Set wmiColl = Nothing
		Set wmiConn = Nothing
	Else
		WScript.Echo "* No Exchange Home Server defined for " & objResults.Fields("samAccountName").value & vbCrLf
	End If

	'move to the next record in the record set; quit when EOF is true
	objResults.MoveNext
	Loop until objResults.EOF

End If
Set objResults = Nothing
Set objADOCmd = Nothing
Set objADOCnxn = Nothing

WScript.Echo "Done!"
WScript.Quit

' Determines which program is used to run this script.
' Returns true if the script host is cscript.exe
Function IsHostCscript()
	On Error Resume Next
	Dim strFullName
	Dim strCommand
	Dim i, j
	Dim bReturn
	bReturn = False
	strFullName = WScript.FullName
	i = InStr(1, strFullName, ".exe", 1)
	If i <> 0 Then
		j = InStrRev(strFullName, "\", i, 1)
		If j <> 0 Then
			strCommand = Mid(strFullName, j+1, i-j-1)
			If LCase(strCommand) = "cscript" Then
				bReturn = True
			End If
		End If
	End If
	If Err <> 0 Then
		Call WScript.echo("Error 0x" & Hex(Err.Number) & " occurred. " & Err.Description _
			& ". " & vbCRLF & "The scripting host could not be determined.")
	End If
	IsHostCscript = bReturn
End Function

SVCC sermons now available via podcast

By Scott, October 2, 2005 10:47 AM

Prior to July 31, Summit View’s sermons were only available via copies of an analog tape recording.  So I took it upon myself to bring SVCC into the late 20th century by digitally recording the service.  I do some minor editing (like removing silence that works fine with a visual service but is awkward when listening only to the audio portion) and make them available in MP3 and WMA formats.  In addition, I make a mixed mode CD with both the CD audio portion and a data portion containing the mp3 and wma files.

Then I was recently asked about making the sermon (or message as we call it) available on iTunes so it can be downloaded automatically and listened to on the go.  So, to bring SVCC into the 21st century, the message of the week is available as a podcast.  You can subscribe to it by searching for the keywords Summit View, or you can subscribe manually (or for anyone who doesn’t want to use iTunes and has another reader they want to use).  The feed is at http://www.flobee.net/SVCC/podcast.xml.

Report the last time your Exchange servers were backed up

By Scott, September 22, 2005 12:14 PM

Like a lot of my scripts, they start from the hard work that someone else has done.  This one began as a similar script that Glen Scales wrote and posted over on his blog.  His version enumerates the servers/stores in a domain and outputs the results to the screen.

My needs required some tweaking since I have servers in multiple domains, and I wanted it to email the results to multiple people who are responsible for backups.  I also needed to account for servers that don”t have public and/or private stores (e.g., front-end servers, conferencing servers).  The script will email the report in HTML format, grouping the stores alphabetically by server name.  Change the constants at the top to suit your needs and then schedule it to run daily.  My next step is to note stores that haven”t been backed up in X days (perhaps two or three) and highlight them in red so it is easy to spot those stores (since my report currently has 60+ stores in it).  Until then, download this version here, or copy it below.

'Change the constants below
CONST strSMTPServer = "Change to server name"
CONST strSMTPRecipient = "Change to recipient address(es)"
CONST strSMTPSender = "Change to sender address"
set conn = createobject("ADODB.Connection")
set mdbobj = createobject("CDOEXM.MailboxStoreDB")
set pdbobj = createobject("CDOEXM.PublicStoreDB")
set com = createobject("ADODB.Command")
Set iAdRootDSE = GetObject("<a href="ldap://RootDSE/">LDAP://RootDSE</a>")
strNameingContext = iAdRootDSE.Get("configurationNamingContext")
Conn.Provider = "ADsDSOObject"
Conn.Open "ADs Provider"
serverQuery = "<GC://" & strNameingContext & ">;(&(objectCategory=msExchExchangeServer));name,distinguishedName;subtree"
Com.ActiveConnection = Conn
Com.Properties("Sort on") = "name"
Com.CommandText = serverQuery
Set Rs = Com.Execute
While Not Rs.EOF
	output = output & "<font size=2><u><b>" & Rs.Fields("name") & "</b></u></font>" & vbcrlf
mbQuery = "<LDAP://" & strNameingContext & ">;(&(objectCategory=msExchPrivateMDB)(legacyExchangeDN=*" & _
	Rs.Fields("name") & "/cn=Microsoft Private MDB));name,distinguishedName;subtree"
	pfQuery = "<LDAP://" & strNameingContext & ">;(&(objectCategory=msExchPublicMDB)(legacyExchangeDN=*" & _
	Rs.Fields("name") & "/cn=Microsoft Public MDB));name,distinguishedName;subtree"
	Com.CommandText = mbQuery
	Set Rs1 = Com.Execute
	If Rs1.RecordCount = 0 Then
		output = output & "<table><tr><td width=50%><font size=2>&nbsp;&nbsp;&nbsp;&nbsp;No mailbox stores." & _
		"</font></td></tr>" & vbcrlf
	Else
		output = output & "<table>"
		While Not Rs1.EOF
			mdbobj.datasource.open "LDAP://" & Rs1.Fields("distinguishedName")
			output = output & "<tr><td width=50%><font size=2>&nbsp;&nbsp;&nbsp;&nbsp;" & Rs1.Fields("name") & _
			" </font></td><td><font size=2>Last Backed Up :" & mdbobj.LastFullBackupTime & "</font></td></tr>" & vbcrlf
			Rs1.MoveNext
		Wend
	End If
	Rs1.Close
	Com.CommandText = pfQuery
	Set Rs2 = Com.Execute
	If Rs2.RecordCount = 0 Then
		output = output & "<tr><td width=50%><font size=2>&nbsp;&nbsp;&nbsp;&nbsp;No public folder store.</td></tr>" & vbcrlf
	Else
		pdbobj.datasource.open "LDAP://" & Rs2.Fields("distinguishedName")
		output = output & "<tr><td width=50%><font size=2>&nbsp;&nbsp;&nbsp;&nbsp;" & _
		Rs2.Fields("name") & " </font></td><td><font size=2>Last Backed Up :" & _
		pdbobj.LastFullBackupTime & "</font></td></tr>" & vbcrlf
	End If
	output = output & "</table>"
	Rs2.Close
	On Error Goto 0
	output = output & vbcrlf
	Rs.MoveNext
Wend
Set iMsg = CreateObject("CDO.Message")
With iMsg
	.To = strSMTPRecipient
	.From = strSMTPSender
	.Subject = "Last Exchange Backup Report"
	.HTMLBody =  output
	.Configuration.Fields.Item("<a href="http://schemas.microsoft.com/cdo/configuration/sendusing">http://schemas.microsoft.com/cdo/configuration/sendusing</a>") = 2
	.Configuration.Fields.Item("<a href="http://schemas.microsoft.com/cdo/configuration/smtpserver">http://schemas.microsoft.com/cdo/configuration/smtpserver</a>") = strSMTPServer
	.Configuration.Fields.Item("<a href="http://schemas.microsoft.com/cdo/configuration/smtpserverport">http://schemas.microsoft.com/cdo/configuration/smtpserverport</a>") = 25
	.Configuration.Fields.Update
	.Send
End With
Rs.Close
Conn.Close
set mdbobj = Nothing
set pdbobj = Nothing
Set Rs = Nothing
Set Rs1 = Nothing
Set Rs2 = Nothing
Set Com = Nothing
Set Conn = Nothing

Panorama Theme by Themocracy