<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>Open a Socket!</title>
	<link>http://www.open-a-socket.com</link>
	<description>Perspectives on Active Directory, Exchange and more</description>
	<pubDate>Mon, 12 Jul 2010 02:47:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Powershell script to add group members based on sIDHistory</title>
		<link>http://www.open-a-socket.com/index.php/2010/07/12/powershell-script-to-add-group-members-based-on-sidhistory/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/07/12/powershell-script-to-add-group-members-based-on-sidhistory/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 02:47:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Active Directory]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/07/12/powershell-script-to-add-group-members-based-on-sidhistory/</guid>
		<description><![CDATA[In a migration scenario it is sometimes useful to have a security and/or distribution Active Directory group in the target domain where the membership is comprised of migrated user objects.  Here&#8217;s a Powershell 2.0 script that I put together that populates the membership of a group based on a specific sIDHistory value.  It can be run [...]]]></description>
			<content:encoded><![CDATA[<p>In a migration scenario it is sometimes useful to have a security and/or distribution Active Directory group in the target domain where the membership is comprised of migrated user objects.  Here&#8217;s a Powershell 2.0 script that I put together that populates the membership of a group based on a specific sIDHistory value.  It can be run as a one-off after the migration or can be invoked via a scheduled task to keep up to date during a migration.</p>
<p>The script also creates a new event log source and then writes the logging information to the application event log on the machine from which it is run.  This is not essential to the script, so scrub it out if you want to. </p>
<p><font color="#ff0000">You can download a copy of the script </font><font color="#ff0000">here: <a href="http://www.open-a-socket.com/wp-content/uploads/2010/07/sidhistorybasedgroupmembership.txt" title="sidhistorybasedgroupmembership.txt">sidhistorybasedgroupmembership.txt</a></font></p>
<pre>#########################################################
#
# Name: SIDHistoryBasedGroupMembership.ps1
# Author: Tony Murray
# Version: 1.0
# Date: 11/07/2010
# Comment: PowerShell 2.0 script to
# populate group membership based on sIDHistory values
#
#########################################################  

#Import the Active Directory Powershell Module
Import-Module ActiveDirectory -ErrorAction SilentlyContinue   

#Create a new Event log source for the script (only needs to be run once)
New-EventLog -logName Application -Source "Legacy Users Group Management" `
-ErrorAction SilentlyContinue   

$SearchBase = "OU=User Objects,DC=fabrikam,DC=local"
$OUArr = Get-ADUser -LDAPFilter "(samaccounttype=805306368)" `
-SearchBase $SearchBase -SearchScope SubTree   

# Now we need the domain security identifier or at least a portion of it
$DomSID = "S-1-5-21-1584567894-2535104369-4141123456"   

$Group = "Legacy Users"
$MbrArr = get-adgroupmember -identity $Group   

# Loop through the Users found beneach the OU tree
# and check to see if the user is already
# a member of the group. If so, do nothing.
# If not, then add the user as a member.
Foreach ($User in $OUArr)
{
    $object = [ADSI]"LDAP://$User"
    $objectsidh = $object.sIDHistory.value
    If (!$objectsidh)
    {
        # write-host "sIDHistory is blank"
    }
    Else
    {
        $objectsidh = $Object.getex(“sidhistory”)
        trap
            {
            #write-host "Error: $_"
            continue
            }
        foreach($sid in $objectSidh)
        {
            $sidh = new-object System.Security.Principal.SecurityIdentifier $sid,0
            if ($sidh -Match $DomSID)
            {
                if ($MbrArr -Match $User.distinguishedName)
                {
                    #The user is already member - do nothing
                }
                else
                {
                    # We need to add the user as a member
                    write-eventlog -logname Application `
                    -source "Legacy Users Group Management" `
                    -eventID 3001 -entrytype Information -message "$User added to $Group"
                    Add-ADGroupMember -Identity $Group -Members $User
                }
            }
            else
            {
                # No match with sidHistory - do nothing
            }
        }
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/07/12/powershell-script-to-add-group-members-based-on-sidhistory/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Error when trying to fix a corrupted search catalog</title>
		<link>http://www.open-a-socket.com/index.php/2010/06/21/error-when-trying-to-fix-a-corrupted-search-catalog/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/06/21/error-when-trying-to-fix-a-corrupted-search-catalog/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 22:32:23 +0000</pubDate>
		<dc:creator>T</dc:creator>
		
		<category><![CDATA[Exchange Server]]></category>

		<category><![CDATA[E2010]]></category>

		<category><![CDATA[Exchange Server 2010]]></category>

		<category><![CDATA[update-mailboxdatabasecopy]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/06/21/error-when-trying-to-fix-a-corrupted-search-catalog/</guid>
		<description><![CDATA[I had a problem in my lab environment yesterday when trying to fix a corrupted search catalog on one of my Exchange 2010 mailbox servers.  I knew the search catalog was corrupted because I was seeing the following events:
Log Name:      Application
Source:        ExchangeStoreDB
Date:          21/06/2010 12:02:03 p.m.
Event ID:      123
Task Category: Database recovery
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      MXB02.contoso.com
Description:
At &#8216;21/06/2010 [...]]]></description>
			<content:encoded><![CDATA[<p>I had a problem in my lab environment yesterday when trying to fix a corrupted search catalog on one of my Exchange 2010 mailbox servers.  I knew the search catalog was corrupted because I was seeing the following events:</p>
<p><font color="#000000">Log Name:      Application<br />
Source:        ExchangeStoreDB<br />
Date:          21/06/2010 12:02:03 p.m.<br />
Event ID:      123<br />
Task Category: Database recovery<br />
Level:         Error<br />
Keywords:      Classic<br />
User:          N/A<br />
Computer:      MXB02.contoso.com<br />
Description:<br />
At &#8216;21/06/2010 12:02:01 p.m.&#8217; the Microsoft Exchange Information Store Database &#8216;DB01&#8242; copy on this server experienced a corrupted search catalog. Consult the event log on the server for other &#8220;ExchangeStoreDb&#8221; and &#8220;MSExchange Search Indexer&#8221; events for more specific information about the failure. Reseeding the catalog is recommended via the &#8216;Update-MailboxDatabaseCopy&#8217; task.</font></p>
<p>I knew I had a good copy of the database on my other server (MBX01), so I went ahead and issued the following Powershell command:</p>
<p>Update-MailboxDatabaseCopy -Identity &#8220;DB01\MBX02&#8243; -CatalogOnly</p>
<p>This generated a nasty looking erorr, which corresponded to the following Application event log entry:</p>
<p><font color="#000000">Log Name:      Application<br />
Source:        MSExchange Configuration Cmdlet - Remote Management<br />
Date:          21/06/2010 4:54:08 p.m.<br />
Event ID:      4<br />
Task Category: General<br />
Level:         Error<br />
Keywords:      Classic<br />
User:          N/A<br />
Computer:      MBX02.contoso.com<br />
Description:<br />
(PID 9940, Thread 21) Task Update-MailboxDatabaseCopy writing error when processing record of index 0. Error: Microsoft.Exchange.Cluster.Replay.CiSeederGenericException: A server-side seed operation has failed. Error: An error occurred while performing the seed operation, which may indicate a problem with the source disk. Error: An error occurred while updating the search catalog files from server &#8216;MBX01&#8242; to &#8216;MBX02&#8242;. Error: Can&#8217;t dismount the search catalog. Error: Microsoft.Exchange.Search.Common.FteCatalogNotFoundException: SearchCatalog.Dismount failed, error 0&#215;80043629 &#8212;&gt; System.ComponentModel.Win32Exception: Unknown error (0&#215;80043629)<br />
   &#8212; End of inner exception stack trace &#8212;<br />
   at Microsoft.Exchange.Cluster.Replay.CiFilesSeederInstance.&lt;&gt;c__DisplayClass5.&lt;SeedThreadProcInternal&gt;b__2(Object , EventArgs )<br />
   at Microsoft.Exchange.Cluster.Replay.CiFilesSeederInstance.RetryCiOperation(EventHandler evt) &#8212;&gt; Microsoft.Exchange.Search.Common.FteCatalogNotFoundException: SearchCatalog.Dismount failed, error 0&#215;80043629 &#8212;&gt; System.ComponentModel.Win32Exception: Unknown error (0&#215;80043629)<br />
   &#8212; End of inner exception stack trace &#8212;<br />
   at Microsoft.Exchange.Cluster.Replay.CiFilesSeederInstance.&lt;&gt;c__DisplayClass5.&lt;SeedThreadProcInternal&gt;b__2(Object , EventArgs )<br />
   at Microsoft.Exchange.Cluster.Replay.CiFilesSeederInstance.RetryCiOperation(EventHandler evt)<br />
   &#8212; End of inner exception stack trace (Microsoft.Exchange.Search.Common.FteCatalogNotFoundException) &#8212;<br />
   at Microsoft.Exchange.Cluster.Replay.CiFilesSeederInstance.SeedThreadProcInternal()<br />
   at Microsoft.Exchange.Data.Storage.Cluster.HaRpcExceptionWrapperBase`2.RunRpcServerOperation(String databaseName, RpcServerOperation rpcOperation)<br />
   &#8212; End of stack trace on server (MBX02.contoso.com) &#8212;<br />
   at Microsoft.Exchange.Data.Storage.Cluster.HaRpcExceptionWrapperBase`2.ClientRethrowIfFailed(String databaseName, String serverName, RpcErrorExceptionInfo errorInfo)<br />
   at Microsoft.Exchange.Cluster.Replay.SeedProgressReporter.GetException()<br />
Event Xml:</font></p>
<p>After some fruitless retries and even more fruitless Googling, I finally found a <a href="http://technet.microsoft.com/en-us/library/dd335201.aspx">Technet article </a>that indicates I should have suspended the database copy before running the Update-MailboxDatabaseCopy command.  Sure enough, once I suspended the database copy I was able to run the command successfully.</p>
<p>Interestingly (and somewhat worryingly) the corrupted search index appeared immediately after an attempt to perform a server switchover.  If I didn&#8217;t know better I would think that the switchover generated the corruption. <img src='http://www.open-a-socket.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Hopefully this will help others who run into the same problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/06/21/error-when-trying-to-fix-a-corrupted-search-catalog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Error when uninstalling Exchange 2010 from server</title>
		<link>http://www.open-a-socket.com/index.php/2010/05/26/error-when-uninstalling-exchange-2010-from-server/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/05/26/error-when-uninstalling-exchange-2010-from-server/#comments</comments>
		<pubDate>Wed, 26 May 2010 20:46:21 +0000</pubDate>
		<dc:creator>T</dc:creator>
		
		<category><![CDATA[Exchange Server]]></category>

		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/05/26/error-when-uninstalling-exchange-2010-from-server/</guid>
		<description><![CDATA[The other day I had to uninstall Exchange 2010 from a server with the CAS and Hub Transport roles.  It all went well until the point where it was uninstalling the Hub Transport role.  The uninstall then ground to a halt with the following error:
Log Name:      Application
Source:        MSExchange Configuration Cmdlet - Management Console
Date:          20/05/2010 4:11:01 [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I had to uninstall Exchange 2010 from a server with the CAS and Hub Transport roles.  It all went well until the point where it was uninstalling the Hub Transport role.  The uninstall then ground to a halt with the following error:</p>
<p><font color="#000080">Log Name:      Application<br />
Source:        MSExchange Configuration Cmdlet - Management Console<br />
Date:          20/05/2010 4:11:01 p.m.<br />
Event ID:      4<br />
Task Category: General<br />
Level:         Error<br />
Keywords:      Classic<br />
User:          N/A<br />
Computer:      HUBCAS1.contoso.com<br />
Description:<br />
(PID 6920, Thread 31) Task Uninstall-MsiPackage writing error when processing record of index 0. Error: Microsoft.Exchange.Configuration.Tasks.TaskException: Couldn&#8217;t open package &#8216;D:\Program Files\Microsoft\Exchange Server\V14\Mailbox\MSFTE.MSI&#8217;. Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. Error code is 1638. &#8212;&gt; System.ComponentModel.Win32Exception: Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel<br />
   &#8212; End of inner exception stack trace &#8212;<br />
   at Microsoft.Exchange.Management.Deployment.MsiUtility.GetProductCode(String packagePath)<br />
   at Microsoft.Exchange.Management.Deployment.MsiUtility.IsInstalled(String packagePath)<br />
   at Microsoft.Exchange.Management.Deployment.UninstallMsi.InternalValidate()<br />
</font></p>
<p>After scratching my head for a few minutes, I uninstalled Update Rollup 3 for Exchange Server 2010 and then re-tried the uninstall for Exchange.  It went through perfectly. </p>
<p>I hadn&#8217;t realised it was necessary to remove any Update Rollups before uninstalling Exchange, but it it seems it is required in this case.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/05/26/error-when-uninstalling-exchange-2010-from-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Powershell script to show Exchange Server 2010 build information</title>
		<link>http://www.open-a-socket.com/index.php/2010/05/04/powershell-script-to-show-exchange-server-2010-build-information/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/05/04/powershell-script-to-show-exchange-server-2010-build-information/#comments</comments>
		<pubDate>Tue, 04 May 2010 04:45:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Exchange Server]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/05/04/powershell-script-to-show-exchange-server-2010-build-information/</guid>
		<description><![CDATA[This is an updated version of the script that I wrote for Exchange Server 2007.  The new version works for both E2007, E2010 as well as environments where both versions coexist.
Ok, so the script is a bit messy and could use some polish - but, hey, it works for me  
##########################################################
# Name: GetExchangeBuild.ps1
# Author: [...]]]></description>
			<content:encoded><![CDATA[<p>This is an updated version of the <a target="_blank" href="http://www.open-a-socket.com/index.php/2009/11/26/how-to-find-exchange-server-2007-and-build-information/">script that I wrote for Exchange Server 2007</a>.  The new version works for both E2007, E2010 as well as environments where both versions coexist.</p>
<p>Ok, so the script is a bit messy and could use some polish - but, hey, it works for me <img src='http://www.open-a-socket.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<pre>##########################################################
# Name: GetExchangeBuild.ps1
# Author: Tony Murray
# Version: 2.0
# Date: 22/04/2010
# Comment: PowerShell script to list build info
# for each Exchange Server in the organisation
#
#########################################################    

Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction SilentlyContinue     

$exsrvs = (get-exchangeserver)     

foreach ($exsrv in $exsrvs)
{
$version = (get-exchangeserver -identity $exsrv).admindisplayversion
$edition = (get-exchangeserver -identity $exsrv).edition
write-host “=====================================================”
write-host “Exchange Server: $exsrv”
write-host $version
write-host “Edition: $edition”
write-host “Installed Update Rollups:”
$baseKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(’LocalMachine’, $exsrv)
$Version8 = "Version 8."
If ($version -match $Version8)
{
$regKey = “SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\
S-1-5-18\Products\461C2B4266EDEF444B864AD6D9E5B613\Patches\”
}
Else # Version is 14
{
$regKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\
S-1-5-18\Products\AE1D439464EB1B8488741FFA028E291C\Patches\"
}
$baseKey = $baseKey.OpenSubKey($regKey)
$Updates = $baseKey.GetSubKeyNames()
ForEach($Update in $Updates)
{
$fullPath= $regKey + $Update
$UpdateKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(’LocalMachine’, $exsrv)
$UpdateKey = $UpdateKey.OpenSubKey($fullPath)
$values = $UpdateKey.GetValueNames()
ForEach($value in $values)
{
if ($value -eq “DisplayName”)
{Write-host $UpdateKey.GetValue($value)}
}
}
write-host “=====================================================”
}</pre>
<p><font color="#ff0000">Watch out for two the lines beginning with $regKey.  They might wrap in the window here but should be on one line.  Note also that Wordpress does something funky with the character codes and you may need to replace the double-quote characters if you copy/paste the code. <font color="#000000"><font color="#999999">You can download the file here:</font> </font><a href="http://www.open-a-socket.com/wp-content/uploads/2010/05/getexchangebuildv2ps1.txt" title="getexchangebuildv2ps1.txt">getexchangebuildv2ps1.txt</a></font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/05/04/powershell-script-to-show-exchange-server-2010-build-information/feed/</wfw:commentRss>
		</item>
		<item>
		<title>64-bit Version of Acctinfo2.dll</title>
		<link>http://www.open-a-socket.com/index.php/2010/04/27/64-bit-version-of-acctinfo2dll/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/04/27/64-bit-version-of-acctinfo2dll/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 01:05:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Active Directory]]></category>

		<category><![CDATA[Windows Server 2008]]></category>

		<category><![CDATA[Windows Server 2008 R2]]></category>

		<category><![CDATA[64-bit]]></category>

		<category><![CDATA[acctinfo.dll]]></category>

		<category><![CDATA[r2]]></category>

		<category><![CDATA[vista]]></category>

		<category><![CDATA[Windows 7]]></category>

		<category><![CDATA[x64]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/04/27/64-bit-version-of-acctinfo2dll/</guid>
		<description><![CDATA[Some time ago I blogged about the Acctinfo2.dll tool and how unfortunate it was that a 64-bit version was not available.  Well, the good news is that you can now download a 64-bit version from here:
 Acctinfo2_64bit.zip
I have tested the DLL on both Windows Server 2008 and Windows Server 2008 R2 and it seems to work [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago <a target="_blank" href="http://www.open-a-socket.com/index.php/2008/08/24/acctinfo2dll-on-vista-x64/">I blogged about the Acctinfo2.dll tool </a>and how unfortunate it was that a 64-bit version was not available.  Well, the good news is that you can now download a 64-bit version from here:</p>
<p> <a href="http://www.activedir.org/ACCTINFO2_64BIT.zip">Acctinfo2_64bit.zip</a></p>
<p>I have tested the DLL on both Windows Server 2008 and Windows Server 2008 R2 and it seems to work well.  <font color="#ff0000">However,</font> <font color="#ff0000">please note this version is completely unsupported!</font>  Download at use entirely at your own risk.</p>
<p>Tony</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/04/27/64-bit-version-of-acctinfo2dll/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setup Wizard for Update Rollup 3 Ended Prematurely</title>
		<link>http://www.open-a-socket.com/index.php/2010/04/23/setup-wizard-for-update-rollup-3-ended-prematurely/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/04/23/setup-wizard-for-update-rollup-3-ended-prematurely/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 03:47:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Exchange Server]]></category>

		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/04/23/setup-wizard-for-update-rollup-3-ended-prematurely/</guid>
		<description><![CDATA[You receive the following message when installing Update Rollup 3 for Exchange Server 2010:
&#8220;Setup Wizard for Update Rollup 3 for Exchange Server 2010 (KB981401) ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.&#8221;

In my case this turned out to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.open-a-socket.com/wp-content/uploads/2010/04/exchange-2010-ru3-error.JPG" title="exchange-2010-ru3-error.JPG"></a><a href="http://www.open-a-socket.com/wp-content/uploads/2010/04/exchange-2010-ru3-error-2.JPG" title="exchange-2010-ru3-error-2.JPG"></a>You receive the following message when installing Update Rollup 3 for Exchange Server 2010:</p>
<p>&#8220;Setup Wizard for Update Rollup 3 for Exchange Server 2010 (KB981401) ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.&#8221;</p>
<p><a href="http://www.open-a-socket.com/wp-content/uploads/2010/04/exchange-2010-ru3-error.JPG" title="exchange-2010-ru3-error.JPG"><img src="http://www.open-a-socket.com/wp-content/uploads/2010/04/exchange-2010-ru3-error.thumbnail.JPG" alt="exchange-2010-ru3-error.JPG" /></a></p>
<p>In my case this turned out to to be a User Account Control (UAC) gotcha.  Basically, I didn&#8217;t launch the *.msp file using &#8220;Run as Administrator&#8221;.  Interestingly, the error is misleading in that it <strong>does</strong> <strong>modify the system</strong>.  If you look at the installed updates on the system the Update Rollup appears as being installed.  In other words it is partly installed.</p>
<p><a href="http://www.open-a-socket.com/wp-content/uploads/2010/04/exchange-2010-ru3-error-2.JPG" title="exchange-2010-ru3-error-2.JPG"><img src="http://www.open-a-socket.com/wp-content/uploads/2010/04/exchange-2010-ru3-error-2.thumbnail.JPG" alt="exchange-2010-ru3-error-2.JPG" /></a></p>
<p>The steps to resolve the issue are:</p>
<p>1. Go to Control Panel, Programs, Programs and Features, Installed Updates.  Highlight the update and then click Uninstall.</p>
<p>2. Open a CMD prompt using right-click &#8220;Run as Administrator&#8221;.  Browse to the folder where the file is located and launch the file named Exchange2010-KB981401-x64-en.msp.</p>
<p>One of these days I&#8217;m really going to get the hang of UAC <img src='http://www.open-a-socket.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Until I do, it would be really nice if the Microsoft product teams could provide more helpful error messages for UAC failures.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/04/23/setup-wizard-for-update-rollup-3-ended-prematurely/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Powershell Script to Pre-Seed Computer Objects in AD</title>
		<link>http://www.open-a-socket.com/index.php/2010/04/13/powershell-script-to-pre-seed-computer-objects-in-ad/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/04/13/powershell-script-to-pre-seed-computer-objects-in-ad/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 22:44:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Active Directory]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[Windows Server 2008 R2]]></category>

		<category><![CDATA[computer account]]></category>

		<category><![CDATA[computer object]]></category>

		<category><![CDATA[useraccountcontrol]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/04/13/powershell-script-to-pre-seed-computer-objects-in-ad/</guid>
		<description><![CDATA[Sometimes it&#8217;s useful to pre-create computer objects in the correct OU before joining them to the domain.  This way, you know that they will immediately pick up whatever Group Policies have been assigned to the OU.  Of course, you can create the computer objects in AD manually using Active Directory Users and Computers (dsa.msc) or [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s useful to pre-create computer objects in the correct OU before joining them to the domain.  This way, you know that they will immediately pick up whatever Group Policies have been assigned to the OU.  Of course, you can create the computer objects in AD manually using Active Directory Users and Computers (dsa.msc) or the new Active Directory Administrative Center (dsac).  However, if you&#8217;ve got more than a few computer objects to create it might be helpful to have a script.  Here&#8217;s a Powershell 1.0 sample:</p>
<pre>
##########################################################
# Name: PreSeedComputerObjects.ps1
# Author: Tony Murray
# Version: 1.0
# Date: 12/04/2010
# Comment: PowerShell 1.0 script to
# pre-create AD Computer objects from csv file
#
#########################################################     

# Set the target OU where the computer objects will be created
$ComputerOU  = [ADSI]“LDAP://OU=Workstations,DC=contoso,DC=com“     

# Specify the folder and CSV file to use
$folder = "C:\util\csv"
Set-Location $folder     

$csv = Import-Csv “import.csv”     

# Parse the CSV file line by line
foreach($line in $csv) {
# Assign variables to each attribute
$ComputerName = $line.ComputerName
$samname = $ComputerName + "$"
$Computer = $ComputerOU.create(“Computer”,”cn=$ComputerName”)     

# Populate the minimum set of attributes needed for computer objects
$Computer.put(“sAMAccountName”,$samname)
$Computer.put(“userAccountControl”,4128)
# Commit the changes
write-host "Adding $ComputerName to target OU"
$Computer.setinfo()
# Capture any errors (e.g. object already exists) and move on
        trap
            {
            write-host "Error: $_"
            continue
            }
}
#End</pre>
<p>The format of the CSV file is simply as follows:</p>
<p>ComputerName<br />
&lt;netbios_name_of_computer&gt;</p>
<p>e.g.<br />
ComputerName<br />
wkstn001<br />
wkstn002<br />
wkstn003</p>
<p>The only other point of interest is that we need to define the sAMAccountName and the userAccountControl attributes in the script.  The sAMAccountName is simply the NetBIOS name of the machine with a &#8220;$&#8221; suffix.  It is also important to specify an appropriate value for userAccountControl - in this case a decimal value of 4128 which corresponds to 0&#215;1020 (hex) or (PASSWD_NOTREQD | WORKSTATION_TRUST_ACCOUNT ).</p>
<p>As always, please let me know if you can think of ways to improve the script.  Yes, that includes you <a href="http://bsonposh.com/">Brandon</a>!</p>
<p><font color="#ff0000">Note: When copying the script from the web site, replace the double-quotes before you try it. Wordpress does some funky format changes!</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/04/13/powershell-script-to-pre-seed-computer-objects-in-ad/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Powershell OU Shadow Script</title>
		<link>http://www.open-a-socket.com/index.php/2010/03/28/powershell-ou-shadow-script/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/03/28/powershell-ou-shadow-script/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 23:59:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Active Directory]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Scripting]]></category>

		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/03/28/powershell-ou-shadow-script/</guid>
		<description><![CDATA[It is sometimes useful to have the ability to populate group membership based on the OU in which the prospective members are located.  A good example of where this might be useful is with Fine-Grained Password Policy (FGPP) in Windows Server 2008 AD (and later).  FGPP does not have the ability to use an OU [...]]]></description>
			<content:encoded><![CDATA[<p>It is sometimes useful to have the ability to populate group membership based on the OU in which the prospective members are located.  A good example of where this might be useful is with Fine-Grained Password Policy (FGPP) in Windows Server 2008 AD (and later).  FGPP does not have the ability to use an OU as its scope of management - you are limited to assigning the policy to user or group objects.</p>
<p>The script below shadows a specified OU and populates a group&#8217;s membership based on the contents of the OU.  It is intended to be invoked by the Windows Task Scheduler (taskschd.msc).</p>
<p> Note that it requires Powershell 2.0 and uses the Active Directory module.</p>
<pre>
#########################################################
#
# Name: OUShadow.ps1
# Author: Tony Murray
# Version: 1.0
# Date: 26/03/2010
# Comment: PowerShell 2.0 script to set the members of
# a group based on the OU they live in
#
#########################################################  

#Import the Active Directory Powershell Module  

Import-Module ActiveDirectory -ErrorAction SilentlyContinue  

#Set Variables
$Group = "OU Shadow"
$SearchBase = "OU=User Accounts,DC=Contoso,DC=Com"
$MbrArr = get-adgroupmember -identity $Group
$OUArr = Get-ADUser -LDAPFilter "(samaccounttype=805306368)" -SearchBase $SearchBase  

# Loop through the Users found in the OU
# and check to see if the user is already
# a member of the group.
Foreach ($User in $OUArr)
{
if ($MbrArr -Match $User.distinguishedName)
    {
    # The user is already member - do nothing
    }
else
    {
    # We need to add the user as a member
    Add-ADGroupMember -Identity $Group -Members $User
    }
}  

# Loop through the group membership and remove
# any users that are not in the OU
Foreach ($Mbr in $MbrArr)
{
if ($OUArr -Match $Mbr.distinguishedName)
    {
    # Found user in OU - do nothing
    }
else
    {
    # We need to remove the user as a member
    Remove-ADGroupMember -Identity $Group -Members $Mbr -confirm:$false
    }
}
# End</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/03/28/powershell-ou-shadow-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Powershell 2.0 Script to Backup GPOs</title>
		<link>http://www.open-a-socket.com/index.php/2010/02/25/powershell-20-script-to-backup-gpos/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/02/25/powershell-20-script-to-backup-gpos/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 00:38:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Group Policy]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/02/25/powershell-20-script-to-backup-gpos/</guid>
		<description><![CDATA[&#160;
A little while back I posted a Powershell 1.0 script to backup all the GPOs in a domain.&#160; Now that Powershell 2.0 is available together with the Group Policy module it is much easier to script Group Policy tasks.&#160; The attached script is basically a re-write of my previous script, but now using the Powershell [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>A little while back I posted a <a href="http://www.open-a-socket.com/index.php/2008/12/13/powershell-gpmc-scripts/" target="_blank">Powershell 1.0 script</a> to backup all the GPOs in a domain.&#160; Now that Powershell 2.0 is available together with the Group Policy module it is much easier to script Group Policy tasks.&#160; The attached script is basically a re-write of my previous script, but now using the Powershell 2.0 cmdlets.&#160; </p>
<p>The script is intended for use with the Windows Task Scheduler.&#160; For example, by backing up the GPOs to disk on a daily basis you have a simple method for restoring accidentally deleted (or badly modified) GPOs.&#160; In my customers’ environments I combine this task with a scheduled full volume snapshot to disk, so that a number of days worth of backups are available. </p>
<p>&#160;</p>
<pre>

#########################################################
#
# Name: BackupGPOsV2.ps1
# Author: Tony Murray
# Version: 1.0
# Date: 25/02/2010
# Comment: PowerShell 2.0 script to backup all
# GPOs within a domain
#
######################################################### 

&#160;

# Import the modules that we need
import-module activedirectory
import-module grouppolicy 

# Specify the location for the backups
$BackupPath = &quot;C:\Backup\GPO\&quot; 

# Create the backup folder if it doesn’t exist
if(test-path -path $BackupPath)
{write-host “The folder” $BackupPath “already exists”}
else
{New-Item $BackupPath -type directory} 

&#160;

# Remove any previous backups from the folder
##&#160; Note: You will need to move the backups off to tape/disk
##&#160; archive daily if you need access to older GPO versions
Remove-Item $BackupPath\* -Recurse -Force 

# Find out what domain this computer is in
$mydomain = get-ADDomain -current LocalComputer 

# Get all the GPOs in the specified domain
$AllDomGPOs = get-gpo -domain $mydomain.DNSRoot -all 

# Loop through the array
Foreach ($GPO in $AllDomGPOs)
{
&#160;&#160;&#160; # Backup the GPO to the specified path
&#160;&#160;&#160; backup-GPO $GPO.DisplayName -path $BackupPath
} 

#End 
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/02/25/powershell-20-script-to-backup-gpos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Powershell one-liner for gathering mailbox stats</title>
		<link>http://www.open-a-socket.com/index.php/2010/01/17/powershell-one-liner-for-gathering-mailbox-stats/</link>
		<comments>http://www.open-a-socket.com/index.php/2010/01/17/powershell-one-liner-for-gathering-mailbox-stats/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 19:46:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Exchange Server]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.open-a-socket.com/index.php/2010/01/17/powershell-one-liner-for-gathering-mailbox-stats/</guid>
		<description><![CDATA[&#160;
The Get-MailboxStatistics cmdlet is great for showing a range of detailed information about the mailboxes in your organisation.&#160; Sometimes you need to pare down the information to just the really useful stuff (such as mailbox size, item count, etc.) and push it to a CSV file.&#160; Here’s one that I find helpful:
&#160;


get-exchangeserver &#124; where-object {$_.IsMailboxServer [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>The Get-MailboxStatistics cmdlet is great for showing a range of detailed information about the mailboxes in your organisation.&#160; Sometimes you need to pare down the information to just the really useful stuff (such as mailbox size, item count, etc.) and push it to a CSV file.&#160; Here’s one that I find helpful:</p>
<p>&#160;</p>
<pre>

get-exchangeserver | where-object {$_.IsMailboxServer -eq $true } | `

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | `

Select-Object DisplayName,@{label=&quot;TotalItemSize(MB)&quot;;`

expression={$_.TotalItemSize.Value.ToMB()}},`

ItemCount,ServerName,StorageGroupName,DatabaseName | `

export-csv c:\stats.csv –NoTypeInformation
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-a-socket.com/index.php/2010/01/17/powershell-one-liner-for-gathering-mailbox-stats/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
