<?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 &#187; Exchange 2003</title>
	<atom:link href="http://www.flobee.net/category/exchange/exchange-2003/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flobee.net</link>
	<description>The consequence of not having six hydrocoptic marzelvanes.</description>
	<lastBuildDate>Tue, 24 Aug 2010 18:39:49 +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>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="flobeecode" id="codekeyword">Set-Mailbox</span> attribute, especially if the mailbox is deleted anyway.  I tried using <span class="flobeecode" id="codekeyword">Set-User</span> with the <span class="flobeecode" id="codekeyword">-WindowsEmailAddress</span> parameter, but because the data type is <span class="flobeecode" id="codeplain">Microsoft.Exchange.Data.SmtpAddress</span>, setting the value to &quot;&quot; or <span class="flobeecode" id="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="flobeecode" id="codekeyword">New-Object</span> <span class="flobeecode" id="codeplain">DirectoryServices.DirectoryEntry</span> <span class="flobeecode" id="codestring">&quot;LDAP://UserDN&quot;</span>.  But you will get an error if you try to set the attribute to null (<span class="flobeecode" id="codevariable">$user</span><span class="flobeecode" id="codeplain">.mail = </span><span class="flobeecode" id="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="flobeecode" id="codevariable">$user</span><span class="flobeecode" id="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="flobeecode" id="codeplain">PutEx</span> method.  Using that will let you use the <span class="flobeecode" id="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>2</slash:comments>
		</item>
		<item>
		<title>PowerShell script to report last successful full backup of Exchange 2007</title>
		<link>http://www.flobee.net/powershell-script-to-report-last-successful-full-backup-of-exchange-2007/</link>
		<comments>http://www.flobee.net/powershell-script-to-report-last-successful-full-backup-of-exchange-2007/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 14:28:27 +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=297</guid>
		<description><![CDATA[Edit:  The inline code in this post is not the latest version of the script.  Get the latest version from the downloads page.
This script is a port of my original backup report that was written in VBScript.&#160; That script reports on both 2003 and 2007 servers, but lacked some of the features that [...]]]></description>
			<content:encoded><![CDATA[<p><font color="red">Edit:  The inline code in this post is not the latest version of the script.  Get the latest version from the <a href="/downloads">downloads</a> page.</font></p>
<p>This script is a port of my <a href="http://www.flobee.net/updated-last-backup-report-script/">original backup report</a> that was written in VBScript.&nbsp; That script reports on both 2003 and 2007 servers, but lacked some of the features that I wanted to put in.&nbsp; PowerShell natively supports date-awareness, which makes it much easier to add the number one feature I wanted to add: highlighting servers that haven&#8217;t had backups since a specified period of time.</p>
<p>Because I am using the native Exchange cmdlets instead of WMI or CDOEXM, this only reports on Exchange 2007 servers.&nbsp; I figure accommodating both is more work than it is worth, so I just modified my VBScript version to not include any server in the Exchange 12 admin group and I have both run every day until my migration to 2007 is complete.</p>
<p>The script reports the last successful full backup of any Exchange 2007 server with the mailbox role installed.&nbsp; It checks for the presence of storage groups and databases within them.&nbsp; It notes if a backup is currently in progress, as well as if a backup has never completed.&nbsp; If a backup has not completed in the last 72 hours (modifiable), it is highlighted in red so it is easy to spot.&nbsp; If a backup is less than the defined number of hours old, I use the Marlett font to display a green checkmark.&nbsp; This allows for a checkmark without having to reference an external image or embed one.&nbsp; Lastly, the report is emailed.&nbsp; The script is shown below, but you can also just <a href="http://www.flobee.net/download/LastBackupReport.zip">download</a> it.</p>
<pre class="brush:ps;gutter:false;wrap-lines:false;auto-links:false;collapse:true">
#Last Backup Report for Exchange 2007 servers
#Version 1.0 - 7/9/08
#--------------------------------------------

#Begin customization-------------------------
$SmtpServer = "server.domain.com" #Enter FQDN of SMTP server
$SmtpFrom = "Exchange Backups &lt;exchangebackupreport@domain.com&gt;" #Enter sender email address
$SmtpTo = "user1@domain.com","user2@domain.com" #Enter one or more recipient addresses in an array
$SmtpSubject = "Exchange 2007 Last Backup Report" #Enter subject of message
$iNomHours = "72" #Enter number of hours since last backup that requires attention
#End customization---------------------------

$date = Get-Date
$sSpace = "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"
$sOutput = "&lt;table&gt;"

#Checkmark to indicate last backup within nominal time
$sCheckMark = "&lt;span style=""font-family: Marlett; color: green; font-size: 14pt; font-weight: bold""&gt;a&lt;/span&gt;"

#Retrieve Exchange servers with mailbox role
$ExServer = Get-ExchangeServer | where {$_.IsMailboxServer -eq $True} | Sort-Object Name
Foreach ($server in $ExServer)
	{
	$sOutput += "&lt;tr&gt;&lt;td&gt;&lt;font size=2&gt;&lt;u&gt;&lt;b&gt;$server&lt;/b&gt;&lt;/u&gt;&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;"
	#Retrieve storage groups for a given server
	$StorageGroup = $server | Get-StorageGroup | Sort-Object Name
	#Check for absence of any storage groups
	If (($StorageGroup | Measure-Object Name).Count -eq $null)
		{
		$sOutput += "&lt;tr&gt;&lt;td&gt;&lt;font size=2&gt;" + $sSpace + "No storage groups present.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
		}
	Else
		{
		Foreach ($sg in $StorageGroup)
			{
			$sOutput += "&lt;tr&gt;&lt;td&gt;&lt;font size=2&gt;" + $sSpace + $sg.Name + "&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"
			#Retrieve mailbox databases for a given storage group
			$MailboxDatabase = $StorageGroup | Get-MailboxDatabase -Status | Sort-Object Name
			#Check for absence of any databases in storage group
			If (($MailboxDatabase | Measure-Object Name).Count -eq $null)
				{
				$sOutput += "&lt;tr&gt;&lt;td&gt;&lt;font size=2&gt;" + $sSpace + $sSpace + "No mailbox stores present.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"				}
			Else
				{
				Foreach ($db in $MailboxDatabase)
					{
					$sBackupRunning = ""
					#Note if backup is currently running
					If ($db.BackupInProgress -eq $true)
						{$sBackupRunning = "&lt;font size=2 color=blue&gt;(Backup In Progress)&lt;/font&gt;"}
					#Determine if backup has ever completed
					If ($db.LastFullBackup -ne $null)
						{
						$sBackupDay = $db.LastFullBackup.get_DayofWeek()
						$sBackupDateTime = $db.LastFullBackup.ToString("g")
						#Flag if last completed backup started longer than defined variable
						If (($date - $db.LastFullBackup).TotalHours -gt $iNomHours)
							{
							$sLastBackup = "&lt;font size=2&gt;Last Backup Started At: &lt;font color=red&gt;" + $sBackupDay + ", " + $sBackupDateTime + "&lt;/font&gt;&lt;/font&gt;"
							}
						Else
							{
							$sLastBackup = "&lt;font size=2&gt;Last Backup Started At: " + $sBackupDay + ", " + $sBackupDateTime + " &lt;/font&gt;" + $sCheckmark
							}
						}
					Else
						{
						$sLastBackup = "&lt;font size=2&gt;No full backup has completed yet.&lt;/font&gt;"
						}
					$sOutput += "&lt;tr&gt;&lt;td&gt;&lt;font size=2&gt;" + $sSpace + $sSpace + $db.Name + " &lt;/font&gt;&lt;/td&gt;&lt;td&gt;" + $sLastBackup + $sBackupRunning + "&lt;/td&gt;&lt;/tr&gt;"
					}
				}
			}
		}
	}
$sOutput += "&lt;/table&gt;"

#Email results
$SmtpClient = New-Object System.Net.Mail.SmtpClient
$MailMessage = New-Object System.Net.Mail.MailMessage
$SmtpClient.Host = $SmtpServer
$MailMessage.From = $SmtpFrom
Foreach ($address in $smtpTo)
	{$MailMessage.To.Add($address)}
$MailMessage.Subject = $SmtpSubject
$MailMessage.IsBodyHTML = $true
$MailMessage.Body = $sOutput
$SmtpClient.Send($MailMessage)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/powershell-script-to-report-last-successful-full-backup-of-exchange-2007/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Convert a mailbox GUID to the user and display name</title>
		<link>http://www.flobee.net/convert-a-mailbox-guid-to-the-user-and-display-name/</link>
		<comments>http://www.flobee.net/convert-a-mailbox-guid-to-the-user-and-display-name/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 20:39:21 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=277</guid>
		<description><![CDATA[If certain MAPI limits are reached when working with sessions, items, attachments, etc., Exchange will deny further access to that user to that object type.&#160; When this happens event ID 9646 is logged in the Application log.&#160; The description of the event contains a mailbox GUID that is causing the issue, but the GUID alone [...]]]></description>
			<content:encoded><![CDATA[<p>If certain MAPI limits are reached when working with sessions, items, attachments, etc., Exchange will deny further access to that user to that object type.&nbsp; When this happens event ID 9646 is logged in the Application log.&nbsp; The description of the event contains a mailbox GUID that is causing the issue, but the GUID alone does nothing to indicate what user/mailbox is affected.</p>
<p>Microsoft KB <a target="_blank" href="http://support.microsoft.com/kb/899663">899663</a>&nbsp;instructs how to manually transpose GUID into a format that can be used in an LDAP filter so that you can search for a match.&nbsp; Why do all this by hand when a script can do it for you?&nbsp; I took an existing script I had that already does the transposition and added an AD search to return the matching dn.&nbsp; The dn is passed to a name translation function that converts the dn to the NT4 format (domain\username) and displays the match with username and display name.</p>
<p>In addition to the VBScript file, I have also included a compiled version that uses SAPIEN Script Host as the engine.&nbsp; This is a self-contained, runs-in-memory-only, no-DOS-box-comes-up engine from PrimalScript.&nbsp; Running the compiled version is nice since you don&#8217;t have to ensure that CScript is the default host and no DOS box appears while the script is running.</p>
<p>The zip file with both versions is available <a href="http://www.flobee.net/download/MbxGUIDtoMbxName.zip">here </a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/convert-a-mailbox-guid-to-the-user-and-display-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated: Copy DLs from one user to another</title>
		<link>http://www.flobee.net/updated-copy-dls-from-one-user-to-another/</link>
		<comments>http://www.flobee.net/updated-copy-dls-from-one-user-to-another/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 23:01:09 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[inline code]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=202</guid>
		<description><![CDATA[The first version of the script really was quick and dirty, requiring you to manually put the source and target users&#8217; DNs in the script.&#160; Since a coworker has been using the script, I thought it appropriate to update it to prompt for the usernames.&#160; In addition, I added a new feature I recently read [...]]]></description>
			<content:encoded><![CDATA[<p>The first version of the script really was quick and dirty, requiring you to manually put the source and target users&#8217; DNs in the script.&nbsp; Since a coworker has been using the script, I thought it appropriate to update it to prompt for the usernames.&nbsp; In addition, I added a new feature I recently read about, which is to output the results in real-time to a GUI.&nbsp; This is done by creating an object for IE and writing the output similar to wscript.echo, but with the Write method of the object.</p>
<p>Like the original script, since we use automated DLs, too, I look for an indication that a given DL is a SmartDL and skip it.&nbsp; And I now use PrimalScript to work with my scripts, so I use its packager to make an exectuable.&nbsp; This makes it easier and nicer for non-IT end-users who will be running scripts like these.</p>
<p>Download it <a href="http://www.flobee.net/download/CopyDLMembership.zip">here</a>, or copy/paste below.</p>
<pre class="brush:vb;gutter:false;wrap-lines:false;auto-links:false;collapse:true">
'Version 2.0 - July 23, 2007
'Copy distribution group membership from one user to another,
'excluding automated DLs (SmartDL).
'Get source user
While Not bolExit = True
	strOldSamUser = InputBox(&quot;Enter the sAMAccountName of the person to copy DLs FROM.&quot; _
		, &quot;Enter username&quot;)
	If strOldSamUser = &quot;&quot; Then
		WScript.Quit
	End If

	'Find the Global Catalog server
	Set objCont = GetObject(&quot;GC:&quot;)
	For Each objGC In objCont
		strADsPath = objGC.ADsPath
	Next

	Set objConnection = CreateObject(&quot;ADODB.Connection&quot;)
	Set objRecordset = CreateObject(&quot;ADODB.Recordset&quot;)
	objConnection.Provider = &quot;ADsDSOObject&quot;

	objConnection.Open &quot;ADs Provider&quot;
	strQuery = &quot;&lt;&quot; &amp; strADsPath &amp; &quot;&gt;;(&amp;(objectcategory=user)(sAMAccountName=&quot; &amp; strOldSamUser &amp; _
		&quot;));displayName,distinguishedName;subtree&quot;
	Set objRecordset = objConnection.Execute(strQuery)

	If Trim(objRecordset.Fields(&quot;distinguishedName&quot;)) = &quot;&quot; Then
		strNoUser = MsgBox(&quot;Warning: User cannot be found.&nbsp; Verify sAMAccountName.&quot;, vbCritical, &quot;User not found!&quot;)
		bolExit = False
	Else
		intCorrectUser = MsgBox(&quot;Is this the correct user?&quot; &amp; VbCrLf &amp; VbCrLf &amp; &quot;Display Name: &quot; &amp; _
		objRecordset.Fields(&quot;displayName&quot;) &amp; VbCrLf &amp; &quot;DN: &quot; &amp; objRecordset.Fields(&quot;distinguishedName&quot;), _
			vbYesNo, &quot;Old user?&quot;)
		If intCorrectUser &lt;&gt; 6 Then
			bolExit = False
		Else
			strSrcDN = objRecordset.Fields(&quot;distinguishedName&quot;)
			bolExit = True
		End If
	End If
 Wend
'Open IE to display progress and results
Set objIE = CreateObject(&quot;InternetExplorer.Application&quot;)
objIE.AddressBar = False
objIE.Menubar = False
objIE.Toolbar = False
objIE.Resizable = True
objIE.Left = 10
objIE.Height = 450
objIE.Width = 800
objIE.Visible = True
objIE.Navigate(&quot;about:blank&quot;)
While objIE.Busy
	WScript.Sleep 100
Wend
Set objDoc = objIE.Document
objDoc.Open
objDoc.Write(&quot;&lt;TITLE&gt;Copy DL Membership&lt;/TITLE&gt;&quot;)
objDoc.Write(&quot;&lt;BODY BGCOLOR=#C0C0C0&gt;&quot;)
objDoc.Write(&quot;&lt;P&gt;&lt;b&gt;Source:&lt;/b&gt; &quot; &amp; objRecordset.Fields(&quot;distinguishedName&quot;) &amp; &quot;&lt;br&gt;&quot;)
'Get target user
bolExit = False
While Not bolExit = True
	strNewSamUser = InputBox(&quot;Enter the sAMAccountName of the person to copy DLs TO.&quot; _
		, &quot;Enter username&quot;)
	If strNewSamUser = &quot;&quot; Then
		objIE.Quit
		WScript.Quit
	End If
	strQuery = &quot;&lt;&quot; &amp; strADsPath &amp; &quot;&gt;;(&amp;(objectcategory=user)(sAMAccountName=&quot; &amp; strNewSamUser &amp; _
		&quot;));displayName,distinguishedName;subtree&quot;
	Set objRecordset = objConnection.Execute(strQuery)
	If Trim(objRecordset.Fields(&quot;distinguishedName&quot;)) = &quot;&quot; Then
		strNoUser = MsgBox(&quot;Warning: User cannot be found.&nbsp; Verify sAMAccountName.&quot;, vbCritical, &quot;User not found!&quot;)
		bolExit = False
	Else
		intCorrectUser = MsgBox(&quot;Is this the correct user?&quot; &amp; VbCrLf &amp; VbCrLf &amp; &quot;Display Name: &quot; &amp; _
			objRecordset.Fields(&quot;displayName&quot;) &amp; VbCrLf &amp; &quot;DN: &quot; &amp; objRecordset.Fields(&quot;distinguishedName&quot;), _
			vbYesNo, &quot;Old user?&quot;)
		If intCorrectUser &lt;&gt; 6 Then
			bolExit = False
		Else
			Set objTargetUser = GetObject(&quot;LDAP://&quot; &amp; objRecordset.Fields(&quot;distinguishedName&quot;))
			bolExit = True
		End If
	End If
 Wend
 'Write target user to IE window
 objDoc.Write(&quot;&lt;b&gt;Target:&lt;/b&gt; &quot; &amp; objRecordset.Fields(&quot;distinguishedName&quot;) &amp; &quot;&lt;/P&gt;&quot;)
 'Copy DLs
 strDomFQDN = Mid(strSrcDN, InStr(LCase(strSrcDN), &quot;,dc=&quot;) + 4)
 strGCFQDN = Replace(LCase(strDomFQDN), &quot;,dc=&quot;, &quot;.&quot;)
 Set objOldUser = GetObject(&quot;GC://&quot; &amp; strGCFQDN &amp; &quot;/&quot; &amp; strSrcDN)
 For Each strGroup in objOldUser.MemberOf
	On Error Resume Next
	Set objGroup = GetObject(&quot;LDAP://&quot; &amp; strGroup)
	If Not Trim(objGroup.mailNickname) = &quot;&quot; Then
		If Not Instr(objGroup.info, &quot;SmartDL&quot;) &gt; 0 Then
			objGroup.Add(objTargetUser.ADsPath)
			If Err.Number = 0 Then
				objDoc.Write(objGroup.DisplayName &amp; &quot;: Update successful.&lt;br&gt;&quot;)
			Else
				objDoc.Write(objGroup.DisplayName &amp; &quot;: Update UNSUCCESSFUL.&lt;br&gt;&quot;)
			End If
		Else
			objDoc.Write(objGroup.DisplayName &amp; &quot;: Skipped (SmartDL).&lt;br&gt;&quot;)
		End If
	End If
	On Error Goto 0
 Next

 Set objOldUser = Nothing
 Set objTargetUser = Nothing
 Set objIE = Nothing
 Set objRecordset = Nothing
 Set objConnection = Nothing
 </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/updated-copy-dls-from-one-user-to-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and dirty script to copy DLs from one user to another</title>
		<link>http://www.flobee.net/quick-and-dirty-script-to-copy-dls-from-one-user-to-another/</link>
		<comments>http://www.flobee.net/quick-and-dirty-script-to-copy-dls-from-one-user-to-another/#comments</comments>
		<pubDate>Sun, 04 Feb 2007 23:07:35 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[inline code]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=187</guid>
		<description><![CDATA[Edit:  The inline code in this post is not the latest version of the script.  Get the latest version from the downloads page.
It is not uncommon at my company to have to move a user from one domain to another for technical, logistical, or political reasons.  For another set of reasons, moving the [...]]]></description>
			<content:encoded><![CDATA[<p><font color="red">Edit:  The inline code in this post is not the latest version of the script.  Get the latest version from the <a href="/downloads">downloads</a> page.</font></p>
<p>It is not uncommon at my company to have to move a user from one domain to another for technical, logistical, or political reasons.  For another set of reasons, moving the user account to the other domain is not done, instead manually creating a new one and associating the mailbox with the new account.</p>
<p>DL membership does not automatically get updated when this is done, so I have been doing it manually.  It has been on my to-do list for awhile to write a script to copy the DL membership from the old account to the new one.  So I threw this together this morning.  It lacks some of the nice extras my other scripts have (finding the user by logon name, email results, true logging) but it does work.</p>
<p>You have to edit the script to give it the variables for the old and new users&#8217; dn.  It will skip security groups (any group without an alias) and also groups whose Notes (info) attribute contains the word SmartDL.  We use Imanami&#8217;s SmartDL for automated DL membership when applicable.  Those will be automatically updated the next time each of their jobs run.</p>
<p>Download it <a title="Copy DLs from one user to another" href="http://www.flobee.net/download/CopyDLMembership.zip">here</a>, or copy/paste below.</p>
<pre class="brush:vb;gutter:false;wrap-lines:false;auto-links:false;collapse:true">
Option Explicit
Dim strOldUser, strNewUser, objOldUser, objNewUser, strGroup, objGroup
strOldUser = &quot;&quot; 'dn of user to copy from'
strNewUser = &quot;&quot; 'dn of user to copy to'
Set objOldUser = GetObject(&quot;LDAP://&quot; &amp; strOldUser)
Set objNewUser = GetObject(&quot;LDAP://&quot; &amp; strNewUser)
wscript.echo &quot;Source user: &quot; &amp; objOldUser.DisplayName
wscript.echo &quot;Target user: &quot; &amp; objNewUser.DisplayName
For Each strGroup in objOldUser.MemberOf
	On Error Resume Next
	Set objGroup = GetObject(&quot;LDAP://&quot; &amp; strGroup)
    If Not Trim(objGroup.mailNickname) = &quot;&quot; Then
        If Not Instr(objGroup.info, &quot;SmartDL&quot;) &gt; 0 Then
			objGroup.Add(objNewUser.ADsPath)
			If Err.Num = 0 Then
				wscript.echo objGroup.DisplayName &amp; &quot;: Update successful.&quot;
			Else
				wscript.echo objGroup.DisplayName &amp; &quot;: Update UNSUCCESSFUL.&quot;
			End If
        Else
			wscript.echo objGroup.DisplayName &amp; &quot;: Skipped (SmartDL).&quot;
        End If
	End If
	On Error Goto 0
Next
Set objOldUser = Nothing
Set objNewUser = Nothing
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/quick-and-dirty-script-to-copy-dls-from-one-user-to-another/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beware of the impact of the January 11, 2007, IMF update on BES Enterprise Activation messages</title>
		<link>http://www.flobee.net/beware-of-the-impact-of-the-january-11-2007-imf-update-on-bes-enterprise-activation-messages/</link>
		<comments>http://www.flobee.net/beware-of-the-impact-of-the-january-11-2007-imf-update-on-bes-enterprise-activation-messages/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 20:07:40 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=184</guid>
		<description><![CDATA[A couple weeks ago, I started having a problem where BES users who were using Enterprise Activation were getting &#34;Operation timed out&#34; messages when activating.  Existing users still worked fine, as did users who activated via Desktop Manager.  Restarting BES services didn&#8217;t change anything; neither did rebooting.  Event logs didn&#8217;t show much, and the application [...]]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago, I started having a problem where BES users who were using Enterprise Activation were getting &quot;Operation timed out&quot; messages when activating.  Existing users still worked fine, as did users who activated via Desktop Manager.  Restarting BES services didn&#8217;t change anything; neither did rebooting.  Event logs didn&#8217;t show much, and the application logs didn&#8217;t show anything except one line item for when the timeout actually occurred.</p>
<p>A RIM article for troubleshooting EA failures listed several things to check, one of which was that the activation message was actually arriving in the mailbox.  So I checked the Inbox&#8217;s deleted items cache for one of the mailboxes&#8230;nope.  I use a third-party utility called <a href="http://www.windeveloper.com/imftune/">IMF Tune</a> to augment the functionality of the IMF, so I have detailed logs of messages processed by the IMF. (To read a case study regarding my company&#8217;s use of IMF Tune, go <a title="Con-way IMF Tune Case Study" href="http://www.windeveloper.com/imftune/news/2006/0119/casestudycnf.htm" target="_blank">here</a>.)</p>
<p>The logs showed that the activation messages were being deleted/archived at the gateway because their SCL ratings were above the threshold.  Some even were being redirected to the Junk E-mail folder (JMF).  I was wondering why this was the case since I have never had a problem with the activation messages being flagged by the IMF.</p>
<p>Then I remembered that I had updated the IMF definition files on January 18 with the 01/11/07 update, which is right around when the issue started.  For whatever reason, the IMF is now being more discriminatory against the activation messages.  To resolve the issue, I white listed the subdomain the activation messages come from: <strong>*.etp.na.blackberry.net</strong>.  And when it happened again today, I discovered that that user is in Europe and EA messages from those users come from a different subdomain: <strong>*.etp.eu.blackberry.net</strong>.</p>
<p>So if you BES and the IMF, be careful that your gateway and store thresholds don&#8217;t keep the activation messages from reaching the inbox.  And if they do, white list the sender domain.  I didn&#8217;t want to just white list all of blackberry.net, so I am using the subdomain that activation messages originate from.  If there is yet another contintental subdomain out there (for Asia Pacific, perhaps), I might just chain the white list filter to be <strong>blackberry.net</strong> AND the subject begins with <strong>RIM_</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/beware-of-the-impact-of-the-january-11-2007-imf-update-on-bes-enterprise-activation-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why are my nested UDGs not being upgraded to USGs?</title>
		<link>http://www.flobee.net/why-are-my-nested-udgs-not-being-upgraded-to-usgs/</link>
		<comments>http://www.flobee.net/why-are-my-nested-udgs-not-being-upgraded-to-usgs/#comments</comments>
		<pubDate>Thu, 25 Jan 2007 15:07:12 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=181</guid>
		<description><![CDATA[Without going into too much backstory for Exchange admins who already know why UDGs need to be upgraded to USGs for ACLs on public folder and mailboxes, I was having an &#34;intermittently persistent&#34; issue where UDGs that are members of other USGs are not being automatically upgraded to USGs.  Without the automatic upgrade, access to [...]]]></description>
			<content:encoded><![CDATA[<p>Without going into too much backstory for Exchange admins who already know why UDGs need to be upgraded to USGs for ACLs on public folder and mailboxes, I was having an &quot;intermittently persistent&quot; issue where UDGs that are members of other USGs are not being automatically upgraded to USGs.  Without the automatic upgrade, access to the resources the parent USG has been assigned will not work.</p>
<p>I started Googling to see what I could find.  The org-level attribute to control UDG conversion was not set, nor has it ever been in my environment.  UDGs are being successfully upgraded by Exchange; it is just nested UDGs that were having a problem.  Then I found the reason, and there is actually a KB article for it: <a title="Nested UDGs are not converted to USGs" href="http://support.microsoft.com/kb/898082" target="_blank">898082</a>.</p>
<p>By design, for performance reasons, when a UDG is a member, whether direct or nested, and the parent group is a USG, Exchange will not convert the UDG to a USG.  Only if the parent group, the one actually being assigned to a resource, is a UDG at the time it is added to the resource, Exchange will convert the parent group and enumerate all members for other UDGs to be converted.</p>
<p>This makes sense so Exchange doesn&#8217;t enumerate members every time a group is added to a resource to check for member conversions.  Since conversion is meant to be a one-time event, performance would be adversely affected if it had to enumerate all members every time just to check for a UDG that happened to added since the last time.  So the enumeration only happens if the parent group is a UDG, which implies that the group has never been assigned to an Exchange resource and the one-time conversion can occur.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/why-are-my-nested-udgs-not-being-upgraded-to-usgs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot install Exchange 2003 SP2 on an admin machine with Outlook?</title>
		<link>http://www.flobee.net/cannot-install-exchange-2003-sp2-on-an-admin-machine-with-outlook/</link>
		<comments>http://www.flobee.net/cannot-install-exchange-2003-sp2-on-an-admin-machine-with-outlook/#comments</comments>
		<pubDate>Sun, 17 Dec 2006 16:16:10 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=178</guid>
		<description><![CDATA[As all Exchange admins should know, Exchange (and/or ESM) and Outlook are not supported on the same system for a variety of reasons related to MAPI service providers.  However, there is a KB article (here) that tells you how to edit the registry to tell ESM to use mapi32.dll in the \exhsrvr\bin folder instead of [...]]]></description>
			<content:encoded><![CDATA[<p>As all Exchange admins should know, Exchange (and/or ESM) and Outlook are not supported on the same system for a variety of reasons related to MAPI service providers.  However, there is a KB article (<a href="http://support.microsoft.com/kb/329136" target="_blank">here</a>) that tells you how to edit the registry to tell ESM to use mapi32.dll in the \exhsrvr\bin folder instead of the system32 directory.</p>
<p>I was installing ESM on a new application terminal server this morning and could not get SP2 to install.  The error was that Exchange 2003 was not installed and, therefore, you cannot apply a service pack to it.  But I had just installed ESM right before the SP install.  After some troubleshooting, I discovered that I had prematurely created the registry key as described in KB 329136.</p>
<p>The article clearly states to install ESM <em>and</em> the service pack(s) before creating the key.  Apparently, this is why, since the setup routine sees that registry key and it breaks something in it.  Deleting the key and rerunning the SP setup allowed it to proceed normally.</p>
<p>I assume you would also have to delete the key before upgrading to a future service pack, so if you use the key to allow public folder management, remember that its presence will inhibit service pack installations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/cannot-install-exchange-2003-sp2-on-an-admin-machine-with-outlook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated Last Backup Report script</title>
		<link>http://www.flobee.net/updated-last-backup-report-script/</link>
		<comments>http://www.flobee.net/updated-last-backup-report-script/#comments</comments>
		<pubDate>Mon, 04 Dec 2006 18:17:33 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=175</guid>
		<description><![CDATA[I had previously posted (here) a script to create an email that reports the last full backup time of every database in the organization.  There wasn&#8217;t too much in the way of error correcting, so the script in my environment was failing to send anything when an Exchange server went offline recently (but is still [...]]]></description>
			<content:encoded><![CDATA[<p>I had previously posted (<a title="Last Exchange Backup report" href="http://www.flobee.net/report-the-last-time-your-exchange-servers-were-backed-up/">here</a>) a script to create an email that reports the last full backup time of every database in the organization.  There wasn&#8217;t too much in the way of error correcting, so the script in my environment was failing to send anything when an Exchange server went offline recently (but is still in AD).</p>
<p>I have updated the script, which can be downloaded <a title="Last Exchange Backup script" href="http://www.flobee.net/download/lastbackup.zip">here</a>, to not error when this happens and include if it is unable to connect to a specific server and read the last full backup time.  The HTML rendering didn&#8217;t look right for the server reported with an error, and I couldn&#8217;t figure out why, so also updated how the table is built.  Now the report is one big table instead of every server in its own table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/updated-last-backup-report-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated Exchange ActiveSync disable script</title>
		<link>http://www.flobee.net/updated-exchange-activesync-disable-script/</link>
		<comments>http://www.flobee.net/updated-exchange-activesync-disable-script/#comments</comments>
		<pubDate>Sun, 03 Dec 2006 19:48:33 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.flobee.net/?p=172</guid>
		<description><![CDATA[I previously posted (here) a script to disable Exchange ActiveSync for unauthorized users.  The script is based on using the dn of one or more groups to determine authorized users (i.e., if you are in the group, you are allowed).  This method recently failed me (twice) because some of the groups were renamed by another admin [...]]]></description>
			<content:encoded><![CDATA[<p>I previously posted (<a title="Disable Exchange ActiveSync post" href="http://www.flobee.net/script-to-disable-exchange-activesync-for-unauthorized-users/">here</a>) a script to disable Exchange ActiveSync for unauthorized users.  The script is based on using the dn of one or more groups to determine authorized users (i.e., if you are in the group, you are allowed).  This method recently failed me (twice) because some of the groups were renamed by another admin to make them more readable.  Not only were the display names changed, but the objects were renamed as well, so the cn and dn were changed.  This means my script couldn&#8217;t find the groups I had hard-coded, which isn&#8217;t good scripting practice anyway.</p>
<p>I have updated the script, which can be downloaded <a title="Exchange ActiveSync disable script" href="http://www.flobee.net/download/EASDisable.zip">here</a>, to search for the groups based on their objectGUID, which never changes no matter what you do to the object (rename, move, etc.).  Instead of hard-coding the dn of the object, I hard-code the objectGUID.  Then I bind directly to the object based on the GUID to retrieve its dn, which is used in the search filter to find the users I want to modify.</p>
<p>Note that ADO allows you to bind to an object given just its GUID, without having to specify other connection parameters.  You can also use the hexadecimal or binary format of the GUID in the connection string; AD will figure out which format you are using. I used the binary format in my script so that I could just copy and paste the value from <a title="SystemTools' Hyena" href="http://www.systemtools.com/hyena/index.html" target="_blank">Hyena</a> into my script without having to convert to a hex value.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flobee.net/updated-exchange-activesync-disable-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
