<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sidefumbling</title>
	<atom:link href="http://www.flobee.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flobee.net</link>
	<description>The consequence of not having six hydrocoptic marzelvanes.</description>
	<lastBuildDate>Mon, 01 Mar 2010 18:33:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Update to OCS archiving script</title>
		<link>http://www.flobee.net/update-to-ocs-archiving-script/</link>
		<comments>http://www.flobee.net/update-to-ocs-archiving-script/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 18:29:51 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[OCS 2007]]></category>
		<category><![CDATA[OCS 2007 R2]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=471</guid>
		<description><![CDATA[There are a couple of changes that have been made to improve the script.
First, after running a report for a user with thousands of messages and not having any idea of the progress while it was running, I added progress windows during the two phases (content conversion and HTML report creation).  The progress window [...]]]></description>
			<content:encoded><![CDATA[<p>There are a couple of changes that have been made to improve the script.</p>
<p>First, after running a report for a user with thousands of messages and not having any idea of the progress while it was running, I added progress windows during the two phases (content conversion and HTML report creation).  The progress window will tell you how many messages will be processed and how far along it is in that process.</p>
<p>Second, I discovered that hyperlinks in messages were not showing up in the report.  Looking at the HTML (or XML) source, I could see the link was there, but the way it was formatted in the XML file (using element enclosures) meant the conversion to HTML was confusing the parser.  Now I remove those characters prior to the link being written to the XML file.</p>
<p>I also optimized the message body conversion loop to remove redundant or obsolete code that was in the original script.  There are also some minor cosmetic changes here and there.</p>
<p>Lastly, I realized last week that the script only reports on peer-to-peer (P2P) conversations, not multiparty.  I spent some time trying to get multiparty conversations out of the database, but it is proving much more difficult than I anticipated.  The format of multiparty IMs in the archiving database is very different than P2P conversations.  I am still working on it, but I am not sure I will be able to make it work.  In the meantime, I added a note in the report that states it is only for P2P conversations.</p>
<p>The original zip file with the script has been updated, but you can download it here:<br />
Note: There is a file embedded within this post, please visit this post to download the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/update-to-ocs-archiving-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Script to compare deployed BlackBerry handheld firmware with a local repository</title>
		<link>http://www.flobee.net/script-to-compare-deployed-blackberry-handheld-firmware-with-a-local-repository/</link>
		<comments>http://www.flobee.net/script-to-compare-deployed-blackberry-handheld-firmware-with-a-local-repository/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 19:08:07 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[inline code]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=463</guid>
		<description><![CDATA[If you use, say, BlackBerry Web Desktop Manager to facilitate firmware upgrades for users, then you have a bunch of them installed somewhere.  (I have 49 versions among 15 carriers.)  I keep a list of the ones I have installed, but I wanted to be able to compare that to what is actually [...]]]></description>
			<content:encoded><![CDATA[<p>If you use, say, BlackBerry Web Desktop Manager to facilitate firmware upgrades for users, then you have a bunch of them installed somewhere.  (I have 49 versions among 15 carriers.)  I keep a list of the ones I have installed, but I wanted to be able to compare that to what is actually in use among all the users in the organization.  This way I can know which installs are obsolete, when new models are in use, and when newer versions are in use by users.</p>
<p>To use this script, in BlackBerry Manager (I am using 4.1.6) highlight all of your users and right-click on them, then select Export Asset Summary Data.  The script will look for BESHandhelds.txt, but you can edit it to be whatever you want.  The file that I use to track installed versions is just a csv with the following headers: Carrier, Model, Model Name, Version, Installed.  Model Name is not used in the script, but mirrors the fields I use in an internal KB article that users can reference.  Here is a sample table of entries:</p>
<table align="center" border="1">
<tbody>
<tr>
<td>Carrier</td>
<td>Model</td>
<td>Model Name</td>
<td>Version</td>
<td>Installed</td>
</tr>
<tr>
<td>AT&amp;T</td>
<td>8320</td>
<td>Curve</td>
<td>4.5.0.182</td>
<td></td>
</tr>
<tr>
<td>AT&amp;T</td>
<td>8520</td>
<td>Curve</td>
<td>4.6.1.314</td>
<td>No</td>
</tr>
<tr>
<td>KPN</td>
<td>8820</td>
<td></td>
<td>4.5.0.55</td>
<td></td>
</tr>
</tbody>
</table>
<p>I added the Installed field as a way to track models that don&#8217;t actually have a local installation either because there is only one release from the carrier or all handhelds are already on that version so there isn&#8217;t a reason to have it installed.  The script will look for a file called BBFirmware.csv but, again, you can change it to whatever you want.</p>
<p>The <span class="flobeecode" id="codekeyword">switch</span> statement starting in line 17 is to map the carrier name as recorded in BES to how I record it in my file.  The output of the script will let you know carriers that are not defined in the statement, but you will want to add or remove carriers as necessary first.</p>
<p>The output will also let you know if a model is in use that is not found in your installation file, if a there is a newer version for a particular model that is in use, and if all users are using the latest version you have installed.  What this script does <i>not</i> do is determine if you have the latest version that has been released by the carrier (since that would be much harder to do).  Lastly, it will let you know of installations you have for models that are not in use anymore so that you can uninstall them.</p>
<p>I am a perfectionist, so I can already see ways to improve the script, but I would never be done if I didn&#8217;t stop somewhere.  You can download the ps1 file below.<br />
Note: There is a file embedded within this post, please visit this post to download the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/script-to-compare-deployed-blackberry-handheld-firmware-with-a-local-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rio Receiver software can&#8217;t read Unicode ID3 tags</title>
		<link>http://www.flobee.net/rio-receiver-software-cant-read-unicode-id3-tags/</link>
		<comments>http://www.flobee.net/rio-receiver-software-cant-read-unicode-id3-tags/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 01:16:38 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=458</guid>
		<description><![CDATA[I have four Rio Receivers, which use Rio&#8217;s Audio Receiver Manager software on a host PC to serve music.  Over the years, certain tracks wouldn&#8217;t be listed in the database.  I had looked at the encoder used, what ID3 tags were present, coexistence of v1 and v2.x tags, filenames.  But I couldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I have four Rio Receivers, which use Rio&#8217;s Audio Receiver Manager software on a host PC to serve music.  Over the years, certain tracks wouldn&#8217;t be listed in the database.  I had looked at the encoder used, what ID3 tags were present, coexistence of v1 and v2.x tags, filenames.  But I couldn&#8217;t figure it out.</p>
<p>I have since tried several of the alternate ARM programs out there: <a href="http://www.myhap.org.uk/medianet.htm">MediaNet</a>, <a href="http://jreceiver.sourceforge.net/">JReceiver</a>, <a href="http://sourceforge.net/projects/rioplay/">rioplay</a>, and there may have been one or two others.  But I could never get any of them to work.  I got close recently with JReceiver, but instructions that date back to 2003 do not account for today&#8217;s versions of the various components.</p>
<p>I decided to take another look at why some tracks don&#8217;t show up in the database.  Forum postings indicate it should have no problem with ID3v2.x.  All of my tracks have v2.3 and no v1.x tags.  And most tracks are indexed fine.  So I started reading about the history of ID3, the details of the different versions, and notable incompatibilities such as Windows Media Player 12 still won&#8217;t read v2.4 tags.</p>
<p>The text encoding available in ID3v2 made me think because I know of some programs can&#8217;t read a Unicode text file; it must stored in ANSI.  So referred to my tag editing program, <a href="http://www.softpointer.com/tr.htm">Tag &amp; Rename</a>, and there is a setting for enabling the writing of v2 tags in Unicode.  But if a tag is in Unicode format, T&amp;R doesn&#8217;t indicate this; only when a tag is rewritten will it use the appropriate format based on the setting.</p>
<p>I used a different tagging application, <a href="http://kid3.sourceforge.net/">Kid3</a>, to show which tags are in what format (down to individual tags in a track).  I tested with a track and encoded all relevant fields (artist, title, album) in Unicode.  When I indexed it in ARM, it didn&#8217;t show up.  I used Kid3 to change the tags to ISO-8859-1, indexed again, and voila!  I did further testing and determine that if you format, say, title in Unicode but the artist in ISO-8859-1, the artist will show up in the database, but not the song underneath the artist.  So ARM still reads all the tags in a track; it is just those that are encoded in Unicode are not added to the database (the individual tags).</p>
<p>Since I am not trying to use international characters sets there is nothing really to be gained by storing in Unicode.  I have asked the developer of T&amp;R to add the ability to see what format a given tag is in (similar to Kid3), but in the meantime I have been rewriting my tags without the Unicode setting enabled as I check for album art in my tags.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/rio-receiver-software-cant-read-unicode-id3-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OCS Archiving Reporter: Group by conversation, filter dates</title>
		<link>http://www.flobee.net/ocs-archiving-reporter-group-by-conversation-filter-dates/</link>
		<comments>http://www.flobee.net/ocs-archiving-reporter-group-by-conversation-filter-dates/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 00:46:21 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[OCS 2007]]></category>
		<category><![CDATA[OCS 2007 R2]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[inline code]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=433</guid>
		<description><![CDATA[Edit:  The inline code is not the latest version of the script.  To get the latest version, download the full script on the Downloads page (or via the link at the end of the post).
The foundation for my script is from the OCS team at Microsoft, who created the original version.
The script from [...]]]></description>
			<content:encoded><![CDATA[<p><font color="red">Edit:</font>  The inline code is not the latest version of the script.  To get the latest version, download the full script on the <a href="http://www.flobee.net/downloads">Downloads</a> page (or via the link at the end of the post).</p>
<p>The foundation for my script is from the OCS team at Microsoft, who created the <a href="http://communicationsserverteam.com/archive/2009/09/28/584.aspx">original version</a>.</p>
<p>The script from Microsoft grabs all the messages and outputs them all in one big table.  I wanted it to be displayed more logically, grouping an entire conversation (session) together so it is easier to follow the context of the messages.  This proved to be more daunting than I had anticipated.</p>
<p>All messages that occur in the same session have the same value for the SessionIdTime.  With that I can group those messages together.  But I needed a way to know when a new conversation started and ended. To get that I used the RANK function in SQL so that any rank of 1 indicates a new conversation.  The resulting SQL query for a single user is the following (the ticks at the end of the lines are for PowerShell):</p>
<pre class="brush:sql;gutter:false">
SELECT RANK() OVER(PARTITION BY SessionIdTime ORDER BY SessionIdTime, MessageIdTime) AS 'Rank', `
	SessionIdTime, MessageIdTime, Body, ContentTypeId, [from], [to] `
FROM `
(SELECT SessionIdTime, MessageIdTime, Body, ContentTypeId, u1.UserUri AS [from], u2.UserUri AS [to] FROM Messages, `
	Users u1, Users u2 WHERE Messages.FromId = u1.UserId AND Messages.ToId = u2.UserId AND u1.UserUri = '$User1' `
	AND LcsLog.dbo.Messages.Toast IS NULL `
UNION ALL `
SELECT SessionIdTime, MessageIdTime, Body, ContentTypeId, u2.UserUri AS [from], u1.UserUri AS [to] FROM Messages, `
	Users u2, Users u1 WHERE Messages.FromId = u2.UserId AND Messages.ToId = u1.UserId AND u1.UserUri = '$User1' `
	AND LcsLog.dbo.Messages.Toast IS NULL `
)AS dConversation
</pre>
<p>Now that I had the data, I needed to be able to use the XSLT to conditionally close a table the next time a rank of 1 is in the loop.  I had the hardest time trying to make the xsl:if and xsl:choose statements work.  Trying to include a <span class="flobeecode" id="codekeyword">&lt;/table&gt;</span> tag without the loop seeing the opening tag only caused errors.  If I used HTML notation, <span class="flobeecode" id="codekeyword">&amp;lt;/table&amp;gt;</span>, those characters were rendered as their literal ASCII representations rather than being parsed as HTML tags.</p>
<p>After trying for many, many hours, I decided to give up relying on the XML parser to convert the file to HTML and just do that parsing in the PowerShell script.  This has the benefit of not requiring external files to run the script (the XSLT and msxsl.exe).  The code below takes the XML output from the first part of the script and loops through each node (message).  If the rank is 1, it closes the previous table, opens a new one, and writes the message to a row.  If the rank is not 1, it means that a conversation has already been started and the message can simply being written in a new row.</p>
<pre class="brush:ps">
#Convert XML to HTML
$sourceXML = [xml](Get-Content $LocalPath)
Remove-Item -path IM.html -ea SilentlyContinue
pwd | % {[string]$LocalPath = $_.path}
$LocalPath = $LocalPath + "\IM.html"
Add-Content -path $LocalPath -Value '&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"'
Add-Content -Path $LocalPath -Value '  "http://www.w3.org/TR/html4/loose.dtd"&gt;'
Add-Content -Path $LocalPath -Value "&lt;html&gt;"
Add-Content -Path $LocalPath -Value "&lt;head&gt;"
Add-Content -Path $LocalPath -Value "&lt;title&gt;IM Conversation Archive&lt;/title&gt;"
Add-Content -Path $LocalPath -Value "&lt;/head&gt;"
Add-Content -Path $LocalPath -Value "&lt;body&gt;"

Add-Content -Path $LocalPath -Value '&lt;font size="2" face="Verdana"&gt;'
Add-Content -Path $LocalPath -Value "&lt;h2 align=`"center`"&gt;$($sourceXML.IMConversation.Title)&lt;/h2&gt;"
Add-Content -Path $LocalPath -Value "&lt;h3 align=`"center`"&gt;$($sourceXML.IMConversation.Subtitle)&lt;/h2&gt;"
Add-Content -Path $LocalPath -Value "&lt;/font&gt;"
Add-Content -Path $LocalPath -Value '&lt;table border="0" cellpadding="1" width="100%" style="FONT-SIZE:8pt;FONT-FAMILY:verdana"&gt;'
foreach($IM in $sourceXML.IMConversation.IM)
	{
	if ($IM.Rank -eq "1")
		{
		Add-Content -Path $LocalPath -Value "&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;"
		Add-Content -Path $LocalPath -Value '&lt;table border="1" cellpadding="1" width="100%" style="FONT-SIZE:8pt;FONT-FAMILY:verdana">'
		Add-Content -Path $LocalPath -Value '&lt;thead>&lt;tr bgcolor="#C0C0C0" align="center"&gt;'
		Add-Content -Path $LocalPath -Value	'&lt;th&gt;&lt;font color="#0000FF"&gt;Session Time (UTC):&lt;/font&gt;&lt;/th&gt;'
		Add-Content -Path $LocalPath -Value	'&lt;th&gt;&lt;font color="#0000FF"&gt;Message Time (UTC):&lt;/font&gt;&lt;/th&gt;'
		Add-Content -Path $LocalPath -Value	'&lt;th&gt;&lt;font color="#0000FF"&gt;From:&lt;/font&gt;&lt;/th&gt;'
		Add-Content -Path $LocalPath -Value	'&lt;th&gt;&lt;font color="#0000FF"&gt;To:&lt;/font&gt;&lt;/th&gt;'
		Add-Content -Path $LocalPath -Value '&lt;th width="40%"&gt;&lt;font color="#0000FF"&gt;Message:&lt;/font&gt;&lt;/th&gt;'
		Add-Content -Path $LocalPath -Value	"&lt;/tr&gt;&lt;/thead&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;tbody&gt;&lt;tr&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td rowspan=`"100`" valign=`"top`"&gt;$($IM.SessionTime)&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td&gt;$($IM.DateTime)&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td&gt;$($IM.From)&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td&gt;$($IM.To)&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td&gt;$($IM.Body.get_FirstChild().get_Data())&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;/tr&gt;"
		}
	else
		{
		Add-Content -Path $LocalPath -Value	"&lt;tr&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td&gt;$($IM.DateTime)&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td&gt;$($IM.From)&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td&gt;$($IM.To)&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;td&gt;$($IM.Body.get_FirstChild().get_Data())&lt;/td&gt;"
		Add-Content -Path $LocalPath -Value	"&lt;/tr&gt;"
		}
	}

Add-Content -Path $LocalPath -Value "&lt;/table>"
Add-Content -Path $LocalPath -Value "&lt;/body>"
Add-Content -Path $LocalPath -Value "&lt;/html>"
</pre>
<p>Lastly, I wanted to be able to filter on a date range within the archiving database.  So I added two arguments to the script after the users: <span class="flobeecode" id="codekeyword">-start</span> and <span class="flobeecode" id="codekeyword">-end</span>, both which are independently optional.  If you don&#8217;t specify a second user or you only specify an end date with one or two users, you need to use the parameter names in the command.  Otherwise, they are positional.  The date format to use is <span class="flobeecode" id="codestring">&quot;YYYY-MM-DD&quot;</span>.  To account for the presence of the date filter, this code is added to the script:</p>
<pre class="brush:ps">
If ($start -ne '')
	{
	#Start date has been specified
	$startdate = $start
	$start = "and Messages.MessageIdTime &gt;= '$start' "
	}
Else
	{
	$startdate = "Oldest record in the database"
	}

If ($end -ne '')
	{
	#End date has been specified
	$enddate = $end
	$end = "and Messages.MessageIdTime &lt;= '$end' "
	}
Else
	{
	$enddate = "Newest record in the database"
	}
</pre>
<p>The code is able to correctly parse the presence of a start date, end date, or both.  Now the following can be added to the end of the code block in the SQL query that makes up the derived table (the part in the nested parentheses):  <span class="flobeecode" id="codekeyword">+</span> <span class="flobeecode" id="codevariable">$start</span> <span class="flobeecode" id="codekeyword">+</span> <span class="flobeecode" id="codevariable">$end</span> <span class="flobeecode" id="codekeyword">+</span>.</p>
<p>Finally, the output is a pretty page with the subtitle that indicates the date range used, the table headers are formatted to visually separate each conversation, and each table is an indicated of a single conversation, regardless of the number of messages shown.</p>
<p>I don&#8217;t expect you to copy and paste all the code above into the script and have it magically work (especially since I made other minor changes to account for the subtitle, additional arguments, etc.), so you can download the entire script below or on the <a href="http://www.flobee.net/downloads">Downloads</a> page.Note: There is a file embedded within this post, please visit this post to download the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/ocs-archiving-reporter-group-by-conversation-filter-dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exclude toast messages from OCS archiving report</title>
		<link>http://www.flobee.net/exclude-toast-messages-from-ocs-archiving-report/</link>
		<comments>http://www.flobee.net/exclude-toast-messages-from-ocs-archiving-report/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 19:08:40 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=427</guid>
		<description><![CDATA[The OCS team blog has a post with a script for retrieving messages from the archiving database.  As is, the script will retrieve both the plain text version of the first message in a new conversation (as seen in the toast) and the RTF version that is displayed in the conversation window.  The [...]]]></description>
			<content:encoded><![CDATA[<p>The OCS team blog has a post with a <a href="http://communicationsserverteam.com/archive/2009/09/28/584.aspx">script</a> for retrieving messages from the archiving database.  As is, the script will retrieve both the plain text version of the first message in a new conversation (as seen in the toast) and the RTF version that is displayed in the conversation window.  The output of the report, however, doesn&#8217;t distinguish between the toast message and the RTF message, so it just looks like it is a duplicate message.</p>
<p>I have done some testing, and both versions are logged in the database even if you ignore the toast or decline the conversation.  I can&#8217;t think of a case where you will only have the toast logged and not the full message, so I have excluded all toast messages from my copy of the script.  To add this exclusion yourself, add <span class="flobeecode" id="codevariable">AND</span> <span class="flobeecode" id="codeplain">LcsLog.dbo.Messages.Toast</span> <span class="flobeecode" id="codevariable">IS NULL</span> to the SQL queries on lines 23 and 28 before the <span class="flobeecode" id="codestring">UNION</span> operator and before the <span class="flobeecode" id="codestring">ORDER BY</span> clause at the end, for a total of four times.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/exclude-toast-messages-from-ocs-archiving-report/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to clear the mail attribute using PowerShell</title>
		<link>http://www.flobee.net/how-to-clear-the-mail-attribute-using-powershell/</link>
		<comments>http://www.flobee.net/how-to-clear-the-mail-attribute-using-powershell/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 16:09:58 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[inline code]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=409</guid>
		<description><![CDATA[I have been struggling to delete the value in the mail attribute after a mailbox has been deleted.  Exchange populates the mail attribute when a mailbox is created (even though Exchange has no use for the attribute), but doesn&#8217;t clear the attribute when the mailbox is deleted.  With ADUC integration removed in Exchange [...]]]></description>
			<content:encoded><![CDATA[<p>I have been struggling to delete the value in the mail attribute after a mailbox has been deleted.  Exchange populates the mail attribute when a mailbox is created (even though Exchange has no use for the attribute), but doesn&#8217;t clear the attribute when the mailbox is deleted.  With ADUC integration removed in Exchange 2007, a quick way to know if an account has a mailbox is to look at the mail attribute.  But if removing a mailbox no longer clears that attribute, it is difficult know (just by looking at a user account in ADUC) if the account still has a mailbox.</p>
<p>Since Exchange doesn&#8217;t use the mail attribute, you can&#8217;t use the <span class="codekeyword">Set-Mailbox</span> attribute, especially if the mailbox is deleted anyway.  I tried using <span class="codekeyword">Set-User</span> with the <span class="codekeyword">-WindowsEmailAddress</span> parameter, but because the data type is <span class="codeplain">Microsoft.Exchange.Data.SmtpAddress</span>, setting the value to &quot;&quot; or <span class="codevariable">$null</span> doesn&#8217;t work because those aren&#8217;t properly formatted SMTP addresses.</p>
<p>So, I figured I needed to get away from any Exchange cmdlet.  I used PowerShell&#8217;s native support for ADSI to bind to the user object: <span class="codekeyword">New-Object</span> <span class="codeplain">DirectoryServices.DirectoryEntry</span> <span class="codestring">&quot;LDAP://UserDN&quot;</span>.  But you will get an error if you try to set the attribute to null (<span class="codevariable">$user</span><span class="codeplain">.mail = </span><span class="codevariable">$null</span>).  You can set it to an empty value (&quot;&quot;), but you will then get an error when you try to commit the change: <span class="codevariable">$user</span><span class="codeplain">.SetInfo()</span>.</p>
<p>How can you possibly clear this attribute, one that is so easy to do in ADUC just by deleting the value in it?  It is necessary to fall back to the <span class="codeplain">PutEx</span> method.  Using that will let you use the <span class="codeconstant">ADS_PROPERTY_CLEAR</span> constant (indicated by the numeric one in the first argument).  It has taken me days to finally get to this point, so hopefully this post will shorten that time for others trying to do the same thing.</p>
<pre class="brush:ps;gutter:false;collapse:false">
$user = Get-User "username"
$ldapDN = "LDAP://" + $user.distinguishedName
$adUser = New-Object DirectoryServices.DirectoryEntry $ldapDN
$adUser.PutEx(1, "mail", $null)
$adUser.SetInfo()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/how-to-clear-the-mail-attribute-using-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix your presumably bricked Wizard</title>
		<link>http://www.flobee.net/how-to-fix-your-presumably-bricked-wizard/</link>
		<comments>http://www.flobee.net/how-to-fix-your-presumably-bricked-wizard/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 22:15:05 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Windows Mobile]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=158</guid>
		<description><![CDATA[Recently I have been using various betas of CRACING&#8217;s CR96 Touch HD builds of Windows Mobile 6.5.  When I tried to install 6.5.0.2.9, RUU kept crashing on my Windows 7 x64 workstation.  I am pretty sure I installed previous CR96 Touch HD betas aftering installing Windows 7.  I tried application compatibility when [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been using various betas of CRACING&#8217;s <a href="http://forum.xda-developers.com/showthread.php?t=494802" target="_blank">CR96 Touch HD</a> builds of Windows Mobile 6.5.  When I tried to install 6.5.0.2.9, RUU kept crashing on my Windows 7 x64 workstation.  I am pretty sure I installed previous CR96 Touch HD betas aftering installing Windows 7.  I tried application compatibility when running RUU (XP SP2), running as administrator, different RUUs, all with the same MFC application error.</p>
<p>I sent time trying to get an RUU to run successfully, but then went on <a href="http://forum.xda-developers.com/showthread.php?t=293480" target="_blank">ShellTool</a>.  I started flashing the new ROM with it, but after an hour it was still sitting there.  I disconnected the Wizard and either soft- or hard-reset the phone.  Now it got ugly.  The boot screen would come up, displaying the IPL,SPL,Radio, and OS (the latter being 6.5.0.0), but it would never go past it.</p>
<p>I was able to boot the Wizard into the bootloader, so I tried <a href="http://forum.xda-developers.com/download.php?id=9864" target="_blank">MTTY</a>.  I couldn&#8217;t get the USB port to be listed in the drop-down, thinking it was something with Windows 7 or x64.  I then went on to <a href="http://www.nuerom.com/BlogEngine/page/nueTTY-Console.aspx" target="_blank">nueTTY</a>.  I was able to connect with it, so I ran d2s, which backs up the on-chip ROM to SD.  This was successful in that I was now able to put a ROM on the SD card and boot into the bootloader, which prompted me to flash the ROM (I could not get it do this prior to running d2s.  Unfortunately, now booting showed only an IPL, SPL, and Radio version&#8230;.no ROM version installed.</p>
<p>Telling it to flash the ROM resulted in the BINFS being written successfully and then immediately failing with a checksum error.  Now I was really stuck.  I couldn&#8217;t get RUU to run, couldn&#8217;t flash from SD card, there is no OS on the device anymore, and I couldn&#8217;t find anything helpful while using TTY.  So I finally decided to try <a href="http://www.microsoft.com/windows/virtual-pc/default.aspx" target="_blank">Windows XP Mode</a> in Windows 7.  After getting that installed and running, I installed ActiveSync 4.5.  Running the RUU that came with 6.5.0.2.9 only resulted in errors about needing a newer RUU.  I figure this had something to do with the fact that I no longer had any OS on the Wizard.  But RUU didn&#8217;t crash, which was a good sign.  I tried nueTTY again (which needs .NET FW 2.0 and VSTO 2008 runtime).  It could see the Wizard connected, but then dropped right back to a command prompt.  I tried MTTY again, learning that USB will only show up as a valid port if the ActiveSync processes are killed.  MTTY connected, but I couldn&#8217;t find any commands that would help me.</p>
<p>Still with me?  Well, we&#8217;re on the final leg now.  While still using Windows XP Mode, I ran the <a href="http://www.flobee.net/download/CUSTOM__RUU_Wizard.zip">RUU</a> that is for the Wizard and doesn&#8217;t do any CID checks.  This time it detected the Wizard and flashed 6.5.0.2.9 succesfully!  Finally!  That was a harrowing couple of days.</p>
<p>So, what are the key takeaways from this? No, it isn&#8217;t &#8220;Don&#8217;t flash with cooked ROMs that are only in beta.&#8221;
<ul>
<li>Be sure to kill the ActiveSync/WMDC processes to get MTTY to see the USB port.</li>
<li>Connecting to a Windows Mobile device works just fine in Windows XP Mode; the Pocket PC USB Sync driver will be installed automatically once you attach the port in the USB menu of Windows XP Mode.</li>
<li>Running a terminal program, such as MTTY or nueTTY, really can brick your phone if you don&#8217;t know what you&#8217;re doing.</li>
<li>The No ID version of RUU for the Wizard is always good to have on hand.</li>
</ul>
<p>My aging Wizard is now running IPL and SPL 3.08, radio 2.19.11, and CR96 Touch HD ROM 6.5.0.2.9 beta.  My Tilt is running HardSPL 3.29, radio 1.70.19.09, and shifu&#8217;s 3.2 ROM (6.5).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/how-to-fix-your-presumably-bricked-wizard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add caching to mailbox creation load balancing script</title>
		<link>http://www.flobee.net/add-caching-to-mailbox-creation-load-balancing-script/</link>
		<comments>http://www.flobee.net/add-caching-to-mailbox-creation-load-balancing-script/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 19:57:52 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[inline code]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=135</guid>
		<description><![CDATA[In a previous post I instructed how to load balance new mailboxes across databases.  In a large environment, however, this determination can take upwards of 90 seconds.  Normally I don&#8217;t run the mailbox creation script at my company (our IT Security department does), but I ran it yesterday and it took 55 seconds [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://www.flobee.net/load-balance-new-mailbox-creation-across-multiple-databases-and-servers-using-powershell/">previous post</a> I instructed how to load balance new mailboxes across databases.  In a large environment, however, this determination can take upwards of 90 seconds.  Normally I don&#8217;t run the mailbox creation script at my company (our IT Security department does), but I ran it yesterday and it took 55 seconds to determine the database.  That&#8217;s just too long for me.</p>
<p>So I decided to add what was going to be my fallback option in the first place: using a cached list.  This code uses an xml file to keep track of the database to use at a given location and a timestamp of when that entry was last updated.  The xml file uses the following format:</p>
<p>
<pre class="brush:xml;gutter:false;wrap-lines:false;auto-links:false;collapse:false">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;sites&gt;
	&lt;site id=&quot;Name1&quot;&gt;
		&lt;database name=&quot;Server1\Storage Group 1\Mailbox Store 1&quot; /&gt;
		&lt;timestamp time=&quot;2009-09-22T08:59:29.4878574-07:00&quot; /&gt;
	&lt;/site&gt;
	&lt;site id=&quot;Name2&quot;&gt;
		&lt;database name=&quot;Server2\Storage Group 5\Mailbox Store 1&quot; /&gt;
		&lt;timestamp time=&quot;2009-09-22T08:17:51.5632031-07:00&quot; /&gt;
	&lt;/site&gt;
....
&lt;/sites&gt;
</pre>
<p>Set the $sourcexml variable to the full path to the file.  The function that calls this code should set the $Location parameter to whatever value is stored in the id attribute of the site nodes.  The xml file is opened, the timestamp for a given site name is returned, and compared to a time interval (in this case, 24 hours, but you can set it to anything you want).  If less than 24 hours old, the database name in the site node is used.  If more than 24 hours old, it will run the code to determine the database to use (from the other post).  After the determination is made, it writes the database name and the current time back into the xml file and saves it.</p>
<p>The on-demand query for one site ran in 53 seconds through mailbox creation for the first run, but created the second mailbox in 11 seconds.  That is much more tenable, at least for an impatient person like myself.</p>
<pre class="brush:ps;gutter:false;wrap-lines:false;auto-links:false;collapse:false">
$start = Get-Date
$sourcexml = "Path to input xml file.xml"
[xml]$db = Get-Content $sourcexml
$site = $db.sites.site | where {$_.id -eq $Location}
[datetime]$lastUpdate = $site.Timestamp.Time
if (($start - $lastUpdate).TotalHours -lt 24)
	{
	Write-Host "Timstamp for selected site is less than 24 hours old.  Using cached entry."
	$site.database.name
	}
else
	{
	Write-Host "Timestamp for selected site is more than 24 hours old.  Calculating database to use."
	#Run code here to determine database to use
	#
	#When done, continue
	$site.database.name = ($mailboxcount.GetEnumerator() | sort value | select -first 1).key
	$site.timestamp.time = (Get-Date -Format o).ToString()
	$db.save($sourcexml)
	$site.database.name
	}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/add-caching-to-mailbox-creation-load-balancing-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get automatic notification when running low on BES licenses</title>
		<link>http://www.flobee.net/get-automatic-notification-when-running-low-on-bes-licenses/</link>
		<comments>http://www.flobee.net/get-automatic-notification-when-running-low-on-bes-licenses/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 23:57:48 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[inline code]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=81</guid>
		<description><![CDATA[This VBScript uses native SQL connectivity via ADO to query your BlackBerry Enterprise Server configuration database for the current number of users.  Since the license total is not stored in the database you have to set it as a variable in the script.  It then compare the two numbers and if your defined [...]]]></description>
			<content:encoded><![CDATA[<p>This VBScript uses native SQL connectivity via ADO to query your BlackBerry Enterprise Server configuration database for the current number of users.  Since the license total is not stored in the database you have to set it as a variable in the script.  It then compare the two numbers and if your defined threshold is exceeded, it will email you a notification.  Just schedule the script to run daily.  Download a zipped version <a href="/download/BESLicenseMonitor.zip">here</a>, or copy below.</p>
<pre class="brush:vb;gutter:false;wrap-lines:false;auto-links:false;collapse:true">
'BES license usage monitor.  Set current license total, alert threshold, And
'other variables to be notified when the license usage exceeds the threshold.
Dim strSQLServer, strBESDB, iCurrentLicenseTotal, iLicenseThreshold
Dim strMailRecipients, strMailSender, strMailSubject, strMailServer
'*************************************
'------Configurable Variables---------
iCurrentLicenseTotal = 1000 'Total number of licenses in License Management
iLicenseThreshold = 20 'Free licenses threshold for notification
strSQLServer = "ServerName" 'NetBIOS name of SQL Server
strBESDB = "DatabaseName" 'Database name in SQL
'------Notification configuration-----
strMailRecipients = "user1@domain.com,user2@domain.com" 'Command-separated list of addresses
strMailSender = "BESLicenseCounter@domain.com" 'From address
strMailSubject = "BES license usage at critical level" 'Subject of notification message
strMailServer = "smtpserver.domain.com" 'FQDN of smarthost
'*************************************

Dim iCurrentUserTotal, iAvailableLicenses, strSQLQuery, strSQLConn
Dim objSQLConn, objSQLRecordSet, objSQLExec
strSQLConn = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Data Source=" &#038; _
	strSQLServer &#038; "; Initial Catalog=" &#038; strBESDB
strSQLQuery = "Select Count(*) As Total_Users From UserStats"
Set objSQLConn = CreateObject("ADODB.Connection")
Set objSQLRecordSet = CreateObject("ADODB.Recordset")
objSQLConn.Open = strSQLConn
objSQLRecordSet.Open strSQLQuery, objSQLConn
Set objSQLExec = objSQLRecordSet
While Not objSQLExec.EOF
	iCurrentUserTotal = objSQLExec.Fields("Total_Users").Value
	objSQLExec.MoveNext
Wend
iAvailableLicenses = iCurrentLicenseTotal - iCurrentUserTotal
If iAvailableLicenses &lt; iLicenseThreshold Then
	Dim strMailBody
	strMailBody = iCurrentUserTotal &#038; " of " &#038; iCurrentLicenseTotal &#038; " licenses are in use."
	strMailBody = strMailBody &#038; "  It is time to order more licenses."
	SendMail
End If

Sub SendMail
	Set objEmail = CreateObject("CDO.Message")
	objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
	objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strMailServer
	objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
	objEmail.Configuration.Fields.Update
	objEmail.From = strMailSender
	objEmail.To = strMailRecipients
	objEmail.Subject = strMailSubject
	objEmail.HTMLBody = strMailBody
	objEmail.Send
End Sub
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/get-automatic-notification-when-running-low-on-bes-licenses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop ActiveSync from opening an Explorer window when a device is connected</title>
		<link>http://www.flobee.net/stop-activesync-from-opening-an-explorer-window-when-a-device-is-connected/</link>
		<comments>http://www.flobee.net/stop-activesync-from-opening-an-explorer-window-when-a-device-is-connected/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 15:45:17 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Windows Mobile]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=71</guid>
		<description><![CDATA[Does connecting and/or disconnecting a Windows Mobile handheld to your desktop result in an Explorer window opening?  It has been happening to me for so long, and it is really annoying.  Long story short, this is caused by a registry entry.
Navigate to HKLM\Software\Microsoft\Windows CE Services\AutoStartOnConnect.  You will see a value for (Default) [...]]]></description>
			<content:encoded><![CDATA[<p>Does connecting and/or disconnecting a Windows Mobile handheld to your desktop result in an Explorer window opening?  It has been happening to me for so long, and it is really annoying.  Long story short, this is caused by a registry entry.</p>
<p>Navigate to <strong>HKLM\Software\Microsoft\Windows CE Services\AutoStartOnConnect</strong>.  You will see a value for <strong>(Default)</strong> with the data set to what appears to be null (nothing visible in the data field).  Click on the <strong>(Default)</strong> name and then press the delete key.  This will change the data to be <strong>(value not set)</strong>.  If the same thing happens when you disconnect your handheld, do the same thing in the <strong>\AutoStartOnDisconnect</strong> key.  The change takes effect immediately.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/stop-activesync-from-opening-an-explorer-window-when-a-device-is-connected/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
