Powershell查询默认MAPI客户端


当你通过类似Mailto:链接发送邮件,此时邮件客户端就是MAPI客户端。如果要找出到这个MAPI客户端在哪里,这里有个函数能从注册表中获得该信息。

functionGet-MAPIClient
{
    functionRemove-Argument
    {
      param
      (
        $CommandLine
      )
  
      $divider=''if ($CommandLine.StartsWith('"')) 
      { 
        $divider='"'$CommandLine=$CommandLine.SubString(1)
      }
  
      $CommandLine.Split($divider)[0]
    } 
  
  $path='Registry::HKEY_CLASSES_ROOT\mailto\shell\open\command'# create new object to return values 
$returnValue=1|Select-Object-PropertyHasMapiClient,Path,MailTo$returnValue.hasMAPIClient=Test-Path-Path$pathif ($returnValue.hasMAPIClient)
  {
    $values=Get-ItemProperty-Path$path$returnValue.MailTo=$values.'(default)'$returnValue.Path=Remove-Argument$returnValue.MailToif ((Test-Path-Path$returnValue.Path) -eq$false)
    {
      $returnValue.hasMAPIClient=$true
    }
  }
  
  
  $returnValue
} 

Get-MAPIClient

结果类似:

1

原文地址:Finding Default MAPI Client

 

本文链接: https://www.pstips.net/finding-default-mapi-client.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注