错误:Azure功能上的新PSSession [英] Error : New-PSSession on Azure Function
问题描述
我想在Azure Functions(在公司中)在线连接交换。
我的脚本在我的计算机上运行,但在Azure上我有以下错误:
错误:连接到远程服务器outlook.office365.com失败,并显示以下错误消息:访问被拒绝。
有关详细信息,请参阅about_Remote_Troubleshooting帮助主题。 Microsoft.Azure.WebJobs.Script.Rpc.RpcException:结果:错误:连接到远程服务器outlook.office365.com失败,并显示以下错误消息:访问被拒绝。有关更多信息,请参阅about_Remote_Troubleshooting帮助主题
。例外:连接到远程服务器outlook.office365.com失败,并显示以下错误消息:访问被拒绝。有关详细信息,请参阅about_Remote_Troubleshooting帮助主题。
我的代码是:
我相信您需要启用对Exchange Online的访问。
这个例子
允许访问Exchange Online 用户david@contoso.com的PowerShell。Set-User -Identity davi d@contoso.com -RemotePowerShellEnabled
true
To
查看特定用户的Exchange Online PowerShell 访问状态,使用以下语法: / span>Get-User -Identity< UserIdentity> | Format-List RemotePowerShellEnabled此示例显示名为Sarah Jones的用户的Exchange Online PowerShell访问状态。
Get-User -Identity" Sarah Jones" | Format-List RemotePowerShellEnabled
跨度>
Hi,
I would like to connect exchange online in Azure Functions (in a company).
My script works on my computer but on but Azure I have the following error :
ERROR: Connecting to remote server outlook.office365.com failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. Microsoft.Azure.WebJobs.Script.Rpc.RpcException : Result: ERROR: Connecting to remote server outlook.office365.com failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. Exception: Connecting to remote server outlook.office365.com failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
My code is :
I believe you need to enable access to Exchange Online .
This example enables access to Exchange Online PowerShell for the user david@contoso.com.
Set-User -Identity david@contoso.com -RemotePowerShellEnabled
true
To view the Exchange Online PowerShell access status for a specific user, use the following syntax:
Get-User -Identity <UserIdentity> | Format-List RemotePowerShellEnabledThis example displays the Exchange Online PowerShell access status of the user named Sarah Jones.
Get-User -Identity "Sarah Jones" | Format-List RemotePowerShellEnabled
这篇关于错误:Azure功能上的新PSSession的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!