我有一个 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
我做过的事:
我猜也许我必须使用 IIS 模拟,但不太确定,而且我没有找到任何关于如何配置它的详细信息。
你对此有什么建议吗?或者有人曾经做过这个工作吗?
谢谢:)