• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    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

    执行后的结果类似:



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

    您可能感兴趣的文章:
    • 使用HTTP api简单的远程执行PowerShell脚本
    • PowerShell打开或关闭光驱
    上一篇:PowerShell远程安装MSI安装包、EXE可执行程序的方法
    下一篇:Powershell中调用邮件客户端发送邮件的例子
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

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