title: Either a required impersonation level was not provided, or the provided impersonation level is invalid
body: <p>I'm having some issues with a WCF service and Impersonation, I've distilled this to a simple method below. The WCF service is currently self hosted in an exe. The exception message is "Either a required impersonation level was not provided, or the provided impersonation level is invalid".  Checking when the error is thrown, the Identity ImpersonationLevel is set to delegation, as specified on my client and its authenticated through Kerberos. </p>
  
  <p>I'm a bit puzzled, as it seems to me that the requirements of ImpersonationLevel and Authenticaiton have been met. My thinking is that the issue is probably to do with domain settings, which I've set and think are set correctly. So I have two questions:</p>
  
  <ol>
  <li>Should the operation below succeed? (or is it flawed?) </li>
  <li>What settings needs to be configured on a Win2k8 domain to make it work? I'm working of two boxes that are members of the same Win2k8 domain (its a new domain and pretty vanilla, with the intention of testing Impersonation).</li>
  </ol>
  
  <p>Code as follows:</p>
  
  <pre><code>[OperationBehavior(Impersonation = ImpersonationOption.Required)]
  public string Test()
  {
      WindowsIdentity identity = ServiceSecurityContext.Current.WindowsIdentity;
      using (identity.Impersonate())
      {
          ProcessStartInfo pi = new ProcessStartInfo(@"c:\temp\test.bat");
          pi.UseShellExecute = false;
          pi.RedirectStandardOutput = true;
          Process p = Process.Start(pi); // exception thrown here!
          p.WaitForExit();
          string o = p.StandardOutput.ReadToEnd();
          return o;
      }
  }
  </code></pre>
  
  <p>Exception details:</p>
  
  <pre><code>Win32Exception occurred: Either a required impersonation level was not provided, or the provided impersonation level is invalid
     at System.Diagnostics.Process.CreatePipeWithSecurityAttributes(SafeFileHandle&amp; hReadPipe, SafeFileHandle&amp; hWritePipe, SECURITY_ATTRIBUTES lpPipeAttributes, Int32 nSize)
     at System.Diagnostics.Process.CreatePipe(SafeFileHandle&amp; parentHandle, SafeFileHandle&amp; childHandle, Boolean parentInputs)
     at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
     at System.Diagnostics.Process.Start()
     at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
     at MonetEnterprise.Service.SecurityService.Test()
  </code></pre>
  
  <p>Test.bat file contents</p>
  
  <blockquote>
    <p>echo %username%</p>
  </blockquote>