title: getactiveObject command fails for windows 8 and windows 10
body: <p>I have the following Powershell code below that i've compiled into an executable (.exe) file and have packaged it into SCCM to push against several 100 users. I have setup the SCCM package to run as "Install as user" and <strong>not</strong> as an Administrator. The package successfully captures the data for users with Windows 7, <em>but</em> any user that has Windows 8/10 installed <strong>fails</strong> to capture the data I need. </p>
  
  <p>I did a try/catch statement and get this error - "</p>
  
  <blockquote>
    <p>Exception calling "GetActiveObject" with "1" argument(s): "Operation
    unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))"</p>
  </blockquote>
  
  <p>I'm trying to understand why the same exact code works perfectly on Windows 7 machines, but does not work on Windows 8/10. Is there a fix? I would like to avoid using "New-Object -ComObject 'Outlook.Application'" because i don't want to create a new Outlook process in the background (fear of corrupting user's running Outlook session). I need to run the Powershell code to capture the active <em>running</em> Outlook process. Please help. Thank you</p>
  
  <pre><code>$mail = [Runtime.Interopservices.Marshal]::GetActiveObject('Outlook.Application') 
  
  $name = $mail.Application.DefaultProfileName
  </code></pre>
  
  <p>output of <code>$name</code> is stored locally to a log text file.</p>