错误:Azure功能上的新PSSession [英] Error : New-PSSession on Azure Function

查看:88
本文介绍了错误:Azure功能上的新PSSession的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在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帮助主题。


我的代码是: 


$ Username = " ..."

解决方案

我相信您需要启用对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 : 

$Username = "..."

解决方案

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 RemotePowerShellEnabled

This 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆