<?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>Tales from the Datacenter</title>
	<atom:link href="http://www.pburch.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pburch.com/blog</link>
	<description>Tales from the Datacenter</description>
	<lastBuildDate>Tue, 03 Jan 2012 16:45:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Scrubbing Hyper-V Virtual Networks</title>
		<link>http://www.pburch.com/blog/2011/09/05/scrubbing-virtual-networks-from-hyper-v/</link>
		<comments>http://www.pburch.com/blog/2011/09/05/scrubbing-virtual-networks-from-hyper-v/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 03:20:20 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[nvspscrub.js]]></category>
		<category><![CDATA[scrub]]></category>
		<category><![CDATA[scrub virtual network]]></category>
		<category><![CDATA[virtual network]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/?p=407</guid>
		<description><![CDATA[I was installing a new Hyper-V host a few days ago and had some issues when I tried to create the virtual networks.  I setup the virtual networks via Hyper-V Manager, but then the machine disappeared from the network.  Luckily, &#8230; <a href="http://www.pburch.com/blog/2011/09/05/scrubbing-virtual-networks-from-hyper-v/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was installing a new Hyper-V host a few days ago and had some issues when I tried to create the virtual networks.  I setup the virtual networks via Hyper-V Manager, but then the machine disappeared from the network.  Luckily, I had console access.  Turns out, the host couldn&#8217;t renew its IP addresses for some reason.  In my troubleshooting, I decided to try to remove the virtual networks &#8211; but how?</p>
<p>Via this script:<span id="more-407"></span></p>
<blockquote>
<pre>/*
Copyright (c) Microsoft Corporation

Module Name:

    nvspscrub.js

*/

//
// VirtualSwitchManagementService object.  Logical wrapper class for Switch Management Service
//
function
VirtualSwitchManagementService(
    Server,
    User,
    Password
    )
{
    //
    // Define instance fields.
    //
    this.m_VirtualizationNamespace  = null;

    this.m_VirtualSwitchManagementService = null;

    //
    // Instance methods
    //        

    VirtualSwitchManagementService.prototype.DeleteSwitch =
    function(
        VirtualSwitch
        )

    /*++

    Description:

        Deletes a virtual switch

    Arguments:

        VirtualSwitch - Msvm_VirtualSwitch object to delete

    Return Value:

        SWbemMethod.OutParameters object.

    --*/

    {
        var methodName = "DeleteSwitch";

        var inParams = this.m_VirtualSwitchManagementService.Methods_(methodName).inParameters.SpawnInstance_();

        inParams.VirtualSwitch = VirtualSwitch.Path_.Path;

        return this.m_VirtualSwitchManagementService.ExecMethod_(methodName, inParams);
    }

    VirtualSwitchManagementService.prototype.DeleteInternalEthernetPort =
    function(
        InternalEthernetPort
        )

    /*++

    Description:

        Deletes an internal ethernet port

    Arguments:

        InternalEthernetPort - Msvm_InternalEthernetPort to delete

    Return Value:

        SWbemMethod.OutParameters object.

    --*/

    {
        var methodName = "DeleteInternalEthernetPort";

        var inParams = this.m_VirtualSwitchManagementService.Methods_(methodName).inParameters.SpawnInstance_();

        inParams.InternalEthernetPort = InternalEthernetPort.Path_.Path;

        return this.m_VirtualSwitchManagementService.ExecMethod_(methodName, inParams);
    }

    VirtualSwitchManagementService.prototype.UnbindExternalEthernetPort =
    function(
        ExternalEthernetPort
        )

    /*++

    Description:

        Unbinds an external ethernet port from the virtual network subsystem.  Usually this method
         won't be called directly

    Arguments:

        SwitchPort - Msvm_ExternalEthernetPort to unbind.

    Return Value:

        SWbemMethod.OutParameters object.

    --*/

    {
        var methodName = "UnbindExternalEthernetPort";

        var inParams = this.m_VirtualSwitchManagementService.Methods_(methodName).inParameters.SpawnInstance_();

        inParams.ExternalEthernetPort = ExternalEthernetPort.Path_.Path;

        return this.m_VirtualSwitchManagementService.ExecMethod_(methodName, inParams);
    }

    //
    // Utility functions
    //

    VirtualSwitchManagementService.prototype.WaitForNetworkJob =
    function(
        OutParams
        )

    /*++

    Description:

        WMI calls will exit with some type of return result.  Some will require
        a little more processing before they are complete. This handles those
        states after a wmi call.

    Arguments:

        OutParams - the parameters returned by the wmi call.

    Return Value:

        Status code

    --*/

    {
        if (OutParams.ReturnValue == 4096)
        {
            var jobStateStarting        = 3;
            var jobStateRunning         = 4;
            var jobStateCompleted       = 7;

            var networkJob;

            do
            {
                WScript.Sleep(1000);

                networkJob = this.m_VirtualizationNamespace.Get(OutParams.Job);

            } while ((networkJob.JobState == jobStateStarting) ||
                     (networkJob.JobState == jobStateRunning));

            if (networkJob.JobState != jobStateCompleted)
            {
                throw(new Error(networkJob.ErrorCode,
                                networkJob.Description + " failed: " + networkJob.ErrorDescription));
            }

            return networkJob.ErrorCode;
        }

        return OutParams.ReturnValue;
    }

    VirtualSwitchManagementService.prototype.GetSingleObject =
    function(
        SWbemObjectSet
        )

    /*++

    Description:

        Takes a SWbemObjectSet which is expected to have one object and returns the object

    Arguments:

        SWbemObjectSet - The set.

    Return Value:

        The lone member of the set.  Exception thrown if Count does not equal 1.

    --*/

    {
        if (SWbemObjectSet.Count != 1)
        {
            throw(new Error(5, "SWbemObjectSet was expected to have one item but actually had " + SWbemObjectSet.Count));
        }

        return SWbemObjectSet.ItemIndex(0);
    }

    //
    // Aggregate functions
    //
    VirtualSwitchManagementService.prototype.DeleteSwitchAndWait =
    function(
        VirtualSwitch
        )

    /*++

    Description:

        Deletes a switch

    Arguments:

        VirtualSwitch - Msvm_VirtualSwitch to delete

    Return Value:

        None.

    --*/

    {
        var outParams = this.DeleteSwitch(VirtualSwitch);

        var wmiRetValue = this.WaitForNetworkJob(outParams);

        if (wmiRetValue != 0)
        {
            throw(new Error(wmiRetValue, "DeleteSwitch failed"));
        }
    }

    VirtualSwitchManagementService.prototype.DeleteInternalEthernetPortAndWait =
    function(
        InternalEthernetPort
        )
    /*++

    Description:

        Deletes an internal ethernet port

    Arguments:

        InternalEthernetPort - Msvm_InternalEthernetPort to delete

    Return Value:

        SWbemMethod.OutParameters object.

    --*/

    {
        var outParams = this.DeleteInternalEthernetPort(InternalEthernetPort);

        var wmiRetValue = this.WaitForNetworkJob(outParams);

        if (wmiRetValue != 0)
        {
            throw(new Error(wmiRetValue, "DeleteInternalEthernetPortAndWait failed"));
        }
    }

    VirtualSwitchManagementService.prototype.UnbindExternalEthernetPortAndWait =
    function(
        ExternalEthernetPort
        )
    /*++

    Description:

        unbinds an internal ethernet port

    Arguments:

        ExternalEthernetPort - Msvm_ExternalEthernetPort to unbind

    Return Value:

        SWbemMethod.OutParameters object.

    --*/

    {
        var outParams = this.UnbindExternalEthernetPort(ExternalEthernetPort);

        var wmiRetValue = this.WaitForNetworkJob(outParams);

        if (wmiRetValue != 0)
        {
            throw(new Error(wmiRetValue, "UnbindExternalEthernetPortAndWait failed"));
        }
    }

    //
    // Constructor code
    //

    if (Server == null)
    {
        Server = WScript.CreateObject("WScript.Network").ComputerName;
    }

    //
    // Set Namespace fields
    //
    try
    {
        var locator = new ActiveXObject("WbemScripting.SWbemLocator");

        this.m_VirtualizationNamespace = locator.ConnectServer(Server, "root\\virtualization", User, Password);
    }
    catch (e)
    {
        this.m_VirtualizationNamespace = null;

        throw(new Error("Unable to get an instance of Virtualization namespace: " + e.description));
    }

    //
    // Set Msvm_VirtualSwitchManagementService field
    //
    try
    {
        var physicalComputerSystem =
                this.m_VirtualizationNamespace.Get(
                        "Msvm_ComputerSystem.CreationClassName='Msvm_ComputerSystem',Name='" + Server + "'");

        this.m_VirtualSwitchManagementService = this.GetSingleObject(
                                                        physicalComputerSystem.Associators_(
                                                            "Msvm_HostedService",
                                                            "Msvm_VirtualSwitchManagementService",
                                                            "Dependent"));
    }
    catch (e)
    {
        this.m_VirtualSwitchManagementService = null;

        throw(new Error("Unable to get an instance of Msvm_VirtualSwitchManagementService: " + e.description));
    }
}

//
// main
//

var wshShell = WScript.CreateObject("WScript.Shell");

var g_NvspWmi   = null;

Main();

function Main()
{
 WScript.Echo("Looking for nvspwmi...");
 g_NvspWmi   = new VirtualSwitchManagementService();

 WScript.Echo("");
 WScript.Echo("Looking for internal (host) virtual nics...");
 var list = g_NvspWmi.m_VirtualizationNamespace.ExecQuery("SELECT * FROM Msvm_InternalEthernetPort");
 for (i = 0; i &lt; list.Count; i++)
 {
  var next = list.ItemIndex(i);
  WScript.echo(next.DeviceID);
  g_NvspWmi.DeleteInternalEthernetPortAndWait(next);
 }

 WScript.Echo("");
 WScript.Echo("Looking for switches...");
 list = g_NvspWmi.m_VirtualizationNamespace.ExecQuery("SELECT * FROM Msvm_VirtualSwitch");
 for (i = 0; i &lt; list.Count; i++)
 {
  var next = list.ItemIndex(i);
  WScript.echo(next.Name);
  g_NvspWmi.DeleteSwitchAndWait(next);
 }

 WScript.Echo("");
 WScript.Echo("Looking for external nics...");
 list = g_NvspWmi.m_VirtualizationNamespace.ExecQuery("SELECT * FROM Msvm_ExternalEthernetPort WHERE IsBound=TRUE");
 for (i = 0; i &lt; list.Count; i++)
 {
  var next = list.ItemIndex(i);
  WScript.echo(next.DeviceID);
  g_NvspWmi.UnbindExternalEthernetPortAndWait(next);
 }

 WScript.Echo("");
 WScript.Echo("Finished!");
}</pre>
</blockquote>
<p>Copy the above code into a blank text document and save it with the file extention <em>*.js </em>(eg, <em>nvspscrub.js</em>). Run it on your host, and there you go.</p>
<p>Download it <a href="http://www.pburch.com/blog/wp-content/uploads/2011/09/nvspscrub.txt">here</a> and change the file extension from <em>txt</em> to <em>js</em> if you&#8217;d prefer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2011/09/05/scrubbing-virtual-networks-from-hyper-v/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repair Orphaned Users in SQL 2008R2</title>
		<link>http://www.pburch.com/blog/2011/08/18/repair-orphaned-users-in-sql-2008r2/</link>
		<comments>http://www.pburch.com/blog/2011/08/18/repair-orphaned-users-in-sql-2008r2/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 19:43:44 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[orphaned users]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/2011/08/18/repair-orphaned-users-in-sql-2008r2/</guid>
		<description><![CDATA[I was moving a database from a production SQL server to a SQL Express instance.&#160; Per usual, I created a backup of the database on the production server and restored it to the Express instance. This created an orphaned user.&#160; &#8230; <a href="http://www.pburch.com/blog/2011/08/18/repair-orphaned-users-in-sql-2008r2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was moving a database from a production SQL server to a SQL Express instance.&#160; Per usual, I created a backup of the database on the production server and restored it to the Express instance.</p>
<p>This created an orphaned user.&#160; To fix such a user, enter the following in a new query window:</p>
<blockquote><p><font face="Courier New">select &#8216;sp_change_users_login @Action = &#8216; + char(39) + &#8216;auto_fix&#8217; +       <br />char(39) + &#8216;, @usernamepattern = &#8216; + char(39) + name + char(39) + char(13) + &#8216;go&#8217;        <br />from sysusers        <br />where issqluser = 1 and (sid is not null and sid &lt;&gt; 0&#215;0)        <br />and suser_sname(sid) is null        <br />order by name</font></p>
</blockquote>
<p>The results of this query will be the query code to fix the orphaned user(s).</p>
<p>I’ll try to get some screenshots next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2011/08/18/repair-orphaned-users-in-sql-2008r2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Does Direct Access Have to be Such a Pain?</title>
		<link>http://www.pburch.com/blog/2011/06/03/why-does-direct-access-have-to-be-such-a-pain/</link>
		<comments>http://www.pburch.com/blog/2011/06/03/why-does-direct-access-have-to-be-such-a-pain/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 23:18:18 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[direct access]]></category>
		<category><![CDATA[direct access not connecting]]></category>
		<category><![CDATA[enabledaforallnetworks]]></category>
		<category><![CDATA[troubleshooting direct access]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/2011/06/03/why-does-direct-access-have-to-be-such-a-pain/</guid>
		<description><![CDATA[Here’s the setup: one user’s laptop would not connect to corporate resources at all from outside the corporate network.&#160; No other issues with Direct Access.&#160; Just this one user’s laptop.&#160; I tried the normal stuff: can he ping us from &#8230; <a href="http://www.pburch.com/blog/2011/06/03/why-does-direct-access-have-to-be-such-a-pain/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here’s the setup: one user’s laptop would not connect to corporate resources at all from outside the corporate network.&#160; No other issues with Direct Access.&#160; Just this one user’s laptop.&#160; I tried the normal stuff: can he ping us from where ever he is?&#160; Yes.&#160; Does his machine have the correct policies for DA?&#160; Yes.&#160; I even went so far as to clear his session tickets and reapply the group policy via VPN.&#160; No dice.</p>
<p>The output of a netsh dns show state was such that DA said it was configured, but was disabled:</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2011/06/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2011/06/image_thumb.png" width="515" height="185" /></a></p>
<p>As you can see, the laptop has determined that it is outside the corporate network, but it is set to never use DA settings.</p>
<p>After much searching, I stumbled upon the <a href="http://social.technet.microsoft.com/Forums/en-AU/forefrontedgeiag/thread/cd924318-12d3-4b27-ad3c-a50320819241" target="_blank">answer</a> to my issues.&#160; Here’s what happened:</p>
<p>There is a DWORD buried in the registry that flips between three different values based on where the machine is (inside/outside) and whether or not DA is manually set to use local DNS.&#160; The DWORD is here:</p>
<blockquote><p><strong>HKLM\Software\Policies\Microsoft\WindowsNT\DNSClient\        <br /></strong><strong>EnableDAForAllNetworks</strong></p>
</blockquote>
<p>The three <a href="http://msdn.microsoft.com/en-us/library/ff957870(PROT.10).aspx" target="_blank">possible values</a> are 0, 1, and 2.&#160; </p>
<p>0 tells DA to determine whether it should be enabled or disabled based on its network location.&#160; This is normal setting and allows for normal operation – when you’re inside the corporate network turn off, and when you’re outside turn on.</p>
<p>1 sets DA to always on.&#160; This isn’t useful when you’re inside the network.&#160; Perhaps it’s there for testing purposes.</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2011/06/dauselocal.png"><img style="background-image: none; border-right-width: 0px; margin: 2px 0px 0px 6px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="dauselocal" border="0" alt="dauselocal" align="right" src="http://www.pburch.com/blog/wp-content/uploads/2011/06/dauselocal_thumb.png" width="231" height="79" /></a>2 is disabled.&#160; When set to 2, DA doesn’t care where it is, it’s always off.&#160; Consequently, this is what the DWORD’s value is set to when you tell the DA Client to Use local DNS resolution.</p>
<p>&#160;</p>
<p>So, after an hour’s worth of digging, I found that somehow this particular client had the above registry key set to “2”, which effectively turned DA off.&#160; The weird part here was that the DA client was <strong><em>not</em></strong> set to use local DNS.&#160; The registry entry was stuck.</p>
<p>I ended up manually changing it to “0”.&#160; Go figure, DA started working immediately – no reboot required.&#160; Before I finished, I tested turning the DA client to use local DNS and back.&#160; The registry entry appears to now be unstuck.</p>
<p>Why are you such a pain to troubleshoot, Direct Access?&#160; Why?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2011/06/03/why-does-direct-access-have-to-be-such-a-pain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes on Direct Access</title>
		<link>http://www.pburch.com/blog/2011/04/07/notes-on-direct-access/</link>
		<comments>http://www.pburch.com/blog/2011/04/07/notes-on-direct-access/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 02:08:02 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[direct access]]></category>
		<category><![CDATA[teredo]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/2011/04/07/notes-on-direct-access/</guid>
		<description><![CDATA[We’ve been having some weird issues with Direct Access here at the office.  For some reason, clients would work fine one minute, not work at all others, and some clients never worked. After spending some time on the phone with &#8230; <a href="http://www.pburch.com/blog/2011/04/07/notes-on-direct-access/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We’ve been having some weird issues with Direct Access here at the office.  For some reason, clients would work fine one minute, not work at all others, and some clients never worked.</p>
<p>After spending some time on the phone with a Microsoft technician, we tracked the problem down.  Here are a couple notes I wanted to keep from the call.</p>
<h3>Direct Access on Other Networks</h3>
<p>If I take my laptop, which is Direct Access-enabled, into another AD network environment, teredo will disable itself.  That is, if I go to someone else’s office – complete outside of my domain – and my Direct Access client detects a DC outside of its domain, Direct Access will fall back onto IPHTTPS.</p>
<p>This is because teredo is a NAT-bypass mechanism and poses a security risk to other networks.  If you need teredo to work, there is a command that can help:</p>
<blockquote><p>netsh interface teredo set state type=&lt;CLIENT_TYPE&gt;</p></blockquote>
<p>Where client type is one of the following:</p>
<ul>
<li><strong>disabled</strong> – Obviosuly, disables the teredo interface.</li>
<li><strong>client</strong> – This is the default type, and is just a normal client that will adhere to the rule above.</li>
<li><strong>enterpriseclient</strong> – This is a default client, except it will ignore the rule above and build a teredo tunnel, even in the presence of a foreign DC.</li>
<li><strong>server</strong> – This is the type that your UAG server holds.</li>
</ul>
<h3></h3>
<h3></h3>
<h3>Purging the System Account’s Kerberos Ticket</h3>
<p>One client we were troubleshooting was having a hard time applying the policy.  The Microsoft guy ran the following command to manually expire the system account’s ticket.  This effectively forced the client to reevaluate its group memberships.</p>
<blockquote><p>klist –li purge</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2011/04/07/notes-on-direct-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mail vs. wp_mail</title>
		<link>http://www.pburch.com/blog/2011/03/26/393/</link>
		<comments>http://www.pburch.com/blog/2011/03/26/393/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 02:30:55 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[mail()]]></category>
		<category><![CDATA[wordpress mail]]></category>
		<category><![CDATA[wp mail smtp]]></category>
		<category><![CDATA[wp_mail()]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/?p=393</guid>
		<description><![CDATA[I was working on my wife&#8217;s WordPress site tonight after she told me her contact form wasn&#8217;t working.  I had been using the SMTP settings in php.ini to handle email across all the websites I support.  But, I decided to stop using &#8230; <a href="http://www.pburch.com/blog/2011/03/26/393/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was working on my wife&#8217;s WordPress site tonight after she told me her contact form wasn&#8217;t working.  I had been using the SMTP settings in php.ini to handle email across all the websites I support.  But, I decided to stop using that because all emails were be coming from the same account, regardless of domain.</p>
<p>So, I started digging around and there is a plugin for WordPress called, aptly enough, <a href="http://www.callum-macdonald.com/code/wp-mail-smtp/" target="_blank">WP Mail SMTP</a>.  This plugin is great because it allows me to set SMTP settings for individual sites, and it intercepts wp_mail() calls and sends them with the SMTP settings you give it.</p>
<p>This turned out to be my problem.  The theme my wife uses has a built-in contact form, which was hard-coded to use mail() to send from the form.  This no longer worked for me after I removed the SMTP settings from php.ini &#8211; even with the WP Mail SMTP plugin.</p>
<p>I started looking around at what exactly wp_mail() required to function.  Here&#8217;s what the <a href="http://codex.wordpress.org/Function_Reference/wp_mail" target="_blank">WordPress Codex</a> says about what to pass it:</p>
<blockquote><p>wp_mail($to, $subject, $message, $headers, $attachments);</p></blockquote>
<p>Looks oddly like what the <a href="http://php.net/manual/en/function.mail.php" target="_blank">PHP Manual</a> says about mail():</p>
<blockquote><p>mail(<tt>$to</tt> , <tt>$subject</tt> , <tt>$message</tt>, <tt>$additional_headers</tt>, <tt>$additional_parameters</tt>);</p></blockquote>
<p>I tried changing the hard-coded mail() to wp_mail(), and there you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2011/03/26/393/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint and Firefox</title>
		<link>http://www.pburch.com/blog/2010/09/09/sharepoint-and-firefox/</link>
		<comments>http://www.pburch.com/blog/2010/09/09/sharepoint-and-firefox/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 18:38:32 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[NTLM]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Trusted Sites]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/2010/09/09/sharepoint-and-firefox/</guid>
		<description><![CDATA[For those of you that prefer Firefox over IE, here’s a little gem to ease the troubles you undoubtedly have with SharePoint: You can enable NTLM credential pass-through by doing the following: Type about:config into your address bar. Find the &#8230; <a href="http://www.pburch.com/blog/2010/09/09/sharepoint-and-firefox/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For those of you that prefer Firefox over IE, here’s a little gem to ease the troubles you undoubtedly have with SharePoint:</p>
<p>You can enable NTLM credential pass-through by doing the following:</p>
<ol>
<li>Type <strong>about:config</strong> into your address bar.</li>
<li>Find the preference labeled <strong>network.automatic-ntlm-auth.trusted-uris</strong>.</li>
<li>Add the URL of your SharePoint site as a value for this preference.</li>
</ol>
<p>Voilà!&#160; Now your SharePoint site is a “trusted site” in Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2010/09/09/sharepoint-and-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editing Local Groups via the Command Line</title>
		<link>http://www.pburch.com/blog/2010/06/10/editing-local-groups-via-the-command-line/</link>
		<comments>http://www.pburch.com/blog/2010/06/10/editing-local-groups-via-the-command-line/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 17:51:08 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[edit local group]]></category>
		<category><![CDATA[mdt 2010]]></category>
		<category><![CDATA[net command]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/2010/06/10/editing-local-groups-via-the-command-line/</guid>
		<description><![CDATA[I use MDT to deploy our servers here at the office and I’m frequently forgetting build steps – namely adding a certain group to the local Administrators group on all the servers I build.&#160; I was looking for a way &#8230; <a href="http://www.pburch.com/blog/2010/06/10/editing-local-groups-via-the-command-line/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use MDT to deploy our servers here at the office and I’m frequently forgetting build steps – namely adding a certain group to the local Administrators group on all the servers I build.&#160; I was looking for a way to script it and was pleasantly surprised to find out that it’s just a single command that can be run at the command line.</p>
<p>The command:</p>
<blockquote><p>net localgroup Administrators /add &quot;domain\domain group&quot;</p>
</blockquote>
<p align="left">If you want to edit a group other than the local Administrators group, just change “Administrators” above to whatever the appropriate group may be.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2010/06/10/editing-local-groups-via-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bootable USB Media from Microsoft Deployment Toolkit</title>
		<link>http://www.pburch.com/blog/2010/06/04/bootable-usb-media-from-microsoft-deployment-toolkit/</link>
		<comments>http://www.pburch.com/blog/2010/06/04/bootable-usb-media-from-microsoft-deployment-toolkit/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 17:07:57 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[MDT]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[bootable usb]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[microsoft deployment toolkit]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/2010/06/04/bootable-usb-media-from-microsoft-deployment-toolkit/</guid>
		<description><![CDATA[As we continue to forge ahead in our brazen quest to upgrade our enterprise to Windows 7, we’ve found ourselves reaching the limits of what we can reasonably expect from WDS and MDT.&#160; For us, jobsites pose an interesting issue &#8230; <a href="http://www.pburch.com/blog/2010/06/04/bootable-usb-media-from-microsoft-deployment-toolkit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As we continue to forge ahead in our brazen quest to upgrade our enterprise to Windows 7, we’ve found ourselves reaching the limits of what we can reasonably expect from WDS and MDT.&#160; For us, jobsites pose an interesting issue with deployment.</p>
<p>Our jobsites are mostly on DSL with some sort of VPN or MPLS connection back to the office.&#160; Some of our jobsites don’t even have internet.&#160; So, the question becomes how do we deploy Windows 7 to these remote and/or unconnected jobsites.&#160; I don’t think it’s fair to expect seven to nine gigabytes of image and task sequence data to traverse the 3 Mbps (and sometimes 1.5!) link these places have with corporate (or a branch office that has a deployment server).&#160; So, what about taking bootable media with us?</p>
<p>We first thought about carrying around hard drives, but decided trying to get through security at airports or otherwise just having a backpack full of drives seemed a bit problematic.&#160; Our images and all their associated data don’t come close to fitting on a DVD (or even two dual layer ones), so we decided to travel down the USB flash drive road for remote deployments.</p>
<p>Here’s how we did it:</p>
<p>I’ll assume you already have a working MDT installation with all your various OSs, applications, task sequences, and the like.</p>
<p>Step 1: Open your Deployment Share, and navigate down to <strong>Advanced Configuration</strong> and<strong>&#160; Media</strong>.</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb.png" width="244" height="198" /></a></p>
<p>Step 2: Right click <strong>Media</strong> and choose <strong>New Media</strong>.</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb1.png" width="244" height="240" /></a> </p>
<p>Step 3: Fill in a “Media path”.&#160; Make sure this folder exists (or that you create it via the “Browse…” option) or MDT will balk at whatever you put here.&#160; Give it some comments and pick whatever “Selection profile” is necessary for this deployment media.&#160; In my case, I needed a deployment media that contained only x64 related items (so, I created a selection profile that was limited to x64 stuff).&#160; If I tried to put all my deployment data in this media set, I wouldn’t be able to fit it on my meager 32GB flash drive.</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb2.png" width="304" height="307" /></a></p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb3.png" width="304" height="163" /></a></p>
<p>Click <strong>Next </strong>twice.&#160; Then Click <strong>Finish</strong>.</p>
<p>Step 4:&#160; Navigate back to the <strong>Media</strong> section of <strong>Advanced Configuration</strong>.&#160; You’ll see your media listed here in some form of “MEDIA001” and some other information like the media root, which selection profile the media is based on, and your comments.</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image4.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb4.png" width="504" height="120" /></a> </p>
<p>Step 5: Right click the media you just created and choose <strong>Update Media Content</strong>.</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image5.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb5.png" width="304" height="153" /></a> </p>
<p>Step 6: Wait.&#160; MDT is copying all the data and information in your selection profile to the media root.&#160; This may take a while depending on what you’re putting into it.</p>
</p>
</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image6.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb6.png" width="504" height="414" /></a></p>
</p>
<p>Once this is done, you’re ready for your USB drive.</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image7.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb7.png" width="504" height="462" /></a></p>
<p>Step 7: Navigate to the media root you used back in step 3.&#160; Inside you’ll see A folder called “Content” and an ISO image.&#160; This ISO image is ready to burn to a CD or DVD (depending on the size of it, of course).&#160; Of course, my media folder is almost 17GB:</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image8.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb8.png" width="304" height="393" /></a> </p>
</p>
<p>If you know how I can fit this a DVD, I know how you can make a lot of money.</p>
<p>Now, format your properly sized flash as NTFS with the allocation unit size set to default.</p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/06/image9.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb9.png" width="254" height="439" /></a> </p>
<p>Copy the contents of the “Content” folder to the root of the flash drive.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/06/image_thumb10.png" width="504" height="156" /> </p>
<p>Put this flash drive into the USB port on a computer, and boot the machine to the USB hard drive or USB disk option.&#160; And voilà!&#160; You’re imaging from a USB drive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2010/06/04/bootable-usb-media-from-microsoft-deployment-toolkit/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WDS Boot Manager Timeout</title>
		<link>http://www.pburch.com/blog/2010/03/08/wds-boot-manager-timeout/</link>
		<comments>http://www.pburch.com/blog/2010/03/08/wds-boot-manager-timeout/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 19:47:16 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[WDS]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[bcd store]]></category>
		<category><![CDATA[bcdedit]]></category>
		<category><![CDATA[timeout]]></category>
		<category><![CDATA[windows boot manager]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/2010/03/08/wds-boot-manager-timeout/</guid>
		<description><![CDATA[If you use WDS on a regular basis, you know that after PXE booting, WDS loads the Windows Boot Manager to allow you to choose which boot image you’d like to boot with.  You’ll also have undoubtedly been a victim &#8230; <a href="http://www.pburch.com/blog/2010/03/08/wds-boot-manager-timeout/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you use WDS on a regular basis, you know that after PXE booting, WDS loads the Windows Boot Manager to allow you to choose which boot image you’d like to boot with.  You’ll also have undoubtedly been a victim of time (which, by default, is 30 seconds) – where you look away for just a second (I swear!) and WDS has chosen the default boot image and begun to boot.</p>
<p>So, I present you with a way to change that: bcdedit.  Microsoft has a <a href="http://technet.microsoft.com/en-us/library/cc731245%28WS.10%29.aspx#BKMK_21" target="_blank">TechNet article</a> that gives the necessary commands to run on your WDS server to make changes to this timeout value.</p>
<p>You can view the current BCD Store settings via this command (insert your own value for the bold text):</p>
<blockquote><p>bcdedit /enum all /store <strong>&lt;full path and file name of store&gt;</strong></p></blockquote>
<p>An example return will be something like this:</p>
<blockquote>
<pre>C:\&gt;bcdedit /enum all /store e:\RemoteInstall\Boot\<strong>x86</strong>\default.bcd
Windows Boot Manager
--------------------
identifier              {bootmgr}
inherit                 {dbgsettings}
timeout                 30

Real-mode Application (10400009)
--------------------------------
identifier              {40fe5c41-285e-412b-b4cd-0ce498e470a2}
device                  boot
path                    OSChooser\i386\startrom.n12
description             Remote Installation Services
pxesoftreboot           Yes

Debugger Settings
-----------------
identifier              {dbgsettings}
debugtype               Serial
debugport               1
baudrate                115200

Device options
--------------
identifier              {68d9e51c-a129-4ee1-9725-2ab00a957daf}
ramdisksdidevice        boot
ramdisksdipath          \Boot\Boot.SDI</pre>
</blockquote>
<p>You can choose whether to edit your x86 or your x64 store by changing the &#8220;bold “x86” above to the appropriate architecture.  Now, we can see here that the timeout is currently set for 30 seconds.</p>
<p>Here are the commands to change that timeout (insert your own values for the bold text):</p>
<blockquote><p>bcdedit /store <strong>&lt;full path and file name of store&gt;</strong> /set {bootmgr} timeout <strong>&lt;value in seconds&gt;</strong></p></blockquote>
<p>After you change the timeout value, you need to force the BCD store to regenerate:</p>
<blockquote><p>sc control wdsserver 129</p></blockquote>
<p>After this you’ll see an output similar to this:</p>
<blockquote><p><span style="font-family: Courier New;">SERVICE_NAME: wdsserver<br />
TYPE: 20<br />
WIN32_SHARE_PROCESS<br />
STATE: 4  RUNNING<br />
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)<br />
WIN32_EXIT_CODE: 0  (0&#215;0)<br />
SERVICE_EXIT_CODE: 0  (0&#215;0)<br />
CHECKPOINT: 0&#215;0 WAIT_HINT: 0&#215;0</span></p></blockquote>
<p>And you’re done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2010/03/08/wds-boot-manager-timeout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Tale of Build Numbers and Deployment</title>
		<link>http://www.pburch.com/blog/2010/03/05/a-tale-of-build-numbers-and-deployment/</link>
		<comments>http://www.pburch.com/blog/2010/03/05/a-tale-of-build-numbers-and-deployment/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 18:50:39 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[MDT]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[WDS]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[build numbers]]></category>
		<category><![CDATA[build version]]></category>
		<category><![CDATA[mdt 2010]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[setup sources]]></category>
		<category><![CDATA[unable to find setup]]></category>

		<guid isPermaLink="false">http://www.pburch.com/blog/2010/03/05/a-tale-of-build-numbers-and-deployment/</guid>
		<description><![CDATA[I’d just like you to know that I’ve been pulling my hair out all week.&#160; I’m practically bald now.&#160; We’ve been using MDT 2010 for quite some time and I’ve been super happy with it.&#160; Until this week. So, I’ve &#8230; <a href="http://www.pburch.com/blog/2010/03/05/a-tale-of-build-numbers-and-deployment/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’d just like you to know that I’ve been pulling my hair out all week.&#160; I’m practically bald now.&#160; We’ve been using MDT 2010 for quite some time and I’ve been super happy with it.&#160; Until this week.</p>
<p>So, I’ve been creating custom images this week and capturing them to my MDT machine.&#160; I got around to the x86 image, customized it, updated it, captured it, imported it, then tested and failed.&#160; I couldn’t figure out why – hence the hair pulling.&#160; And then I found it.&#160; Like a glowing pot of gold hidden under a rock in the deepest part of the forest, I found the problem: </p>
<p><a href="http://www.pburch.com/blog/wp-content/uploads/2010/03/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.pburch.com/blog/wp-content/uploads/2010/03/image_thumb.png" width="522" height="62" /></a> </p>
<p>The DVD I got the source files from in the top image was build number 6.1.7600.16385.&#160; Some update that I was running on the image I was customizing was updating this build to 6.1.7600.16481.&#160; So, when I would go back to try to test the customized image, I’d get an error at the start of the task sequence that goes something like this:</p>
<blockquote><p>Operating System deployment did not complete successfully.</p>
<p align="left"><strong>Error: Unable to find SETUP , needed to install the image       <br /></strong><strong>\\MDT_Server\DeploymentShare$\Operating Systems\W7x86_CAP_3-4-10\W7x86_CAP_3-4-10.WIM</strong></p>
</blockquote>
<p>I tried the Google route, and found a bunch of unrelated stuff.&#160; Turns out, if the build number is the same on a custom image as on an image with the full source files, MDT will not require setup sources for the custom image.&#160; It will take it from the existing sources in another OS.&#160; So, when it was looking for the setup sources for my 16481 build, it couldn’t find it.</p>
<p>There you have it.&#160; Be careful running updates on custom images.&#160; Make sure you have the sources with the same build number or it won’t work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pburch.com/blog/2010/03/05/a-tale-of-build-numbers-and-deployment/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

