来自 PHP 的远程 Powershell 执行(本地 Exchange):访问被拒绝

问题描述 投票:0回答:1

我有一个 powershell 脚本创建用户邮箱,由在 IIS 10 服务器中运行的 PHP 调用。

问题是,当我在 powershell 中从 Web 服务器运行此脚本时,它可以工作,但是当我从 PHP 运行它时,我得到访问被拒绝

Connecting to remote server server.domain.local failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. At C:\Scripts\AD_CreateMailbox.ps1:46 char:34 + ... sessionEX = New-PSSession -sessionOption $sessionOption -Configuratio ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin gTransportException + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed

我做过的事:

  • 在 Exchange 服务器上启用远程 Powershell
  • 允许 Exchange 的 WinRM 的受信任主机中的 Web 服务器
  • 使用具有创建邮箱适当权限的受限域用户运行网络服务器
  • 允许在 Exchange 服务器上进行 Kerberos 身份验证

我猜也许我必须使用 IIS 模拟,但不太确定,而且我没有找到任何关于如何配置它的详细信息。

你对此有什么建议吗?或者有人曾经做过这个工作吗?

谢谢:)

php powershell iis
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.