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

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

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

  2021-03-19 我要评论
想了解Powershell从注册表中查询默认MAPI客户端的例子的相关内容吗,在本文为您仔细讲解Powershell注册表中查询MAPI客户端的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点: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

执行后的结果类似:



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

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们