主页 > 知识库 > Powershell从注册表中查询默认MAPI客户端的例子

Powershell从注册表中查询默认MAPI客户端的例子

热门标签:百度竞价排名 地方门户网站 铁路电话系统 AI电销 Linux服务器 网站排名优化 服务外包 呼叫中心市场需求

当你通过类似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

执行后的结果类似:



举一反三,同样也可以修改代码查询其它类型的默认客户端。

您可能感兴趣的文章:
  • 使用HTTP api简单的远程执行PowerShell脚本
  • PowerShell打开或关闭光驱

标签:铜川 衡水 兰州 湖南 湘潭 仙桃 黄山 崇左

巨人网络通讯声明:本文标题《Powershell从注册表中查询默认MAPI客户端的例子》,本文关键词  ;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 收缩
    • 微信客服
    • 微信二维码
    • 电话咨询

    • 400-1100-266