Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
传递代理并在系统PowerShell中运行时,连接Exchange Online失败-TokenProvider返回对象引用错误_Powershell_Azure Active Directory_Office365_Exchangewebservices - Fatal编程技术网

传递代理并在系统PowerShell中运行时,连接Exchange Online失败-TokenProvider返回对象引用错误

传递代理并在系统PowerShell中运行时,连接Exchange Online失败-TokenProvider返回对象引用错误,powershell,azure-active-directory,office365,exchangewebservices,Powershell,Azure Active Directory,Office365,Exchangewebservices,我正在使用系统访问打开的PowerShell窗口连接Exchange Online。我在提升的命令提示符下使用PSExec打开系统访问PowerShell。下面是命令 PSExec -i -s PowerShell 在PowerShell上,我导入了最新的。我使用此处描述的基于应用的身份验证: 还有一个网站显示了如何连接基于应用的身份验证: 以下是用于连接到Exchange Online的命令 Import-Module .\ExchangeOnlineManagement $sessopt

我正在使用系统访问打开的PowerShell窗口连接Exchange Online。我在提升的命令提示符下使用PSExec打开系统访问PowerShell。下面是命令

PSExec -i -s PowerShell
在PowerShell上,我导入了最新的。我使用此处描述的基于应用的身份验证:

还有一个网站显示了如何连接基于应用的身份验证:

以下是用于连接到Exchange Online的命令

Import-Module .\ExchangeOnlineManagement
$sessopt = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -ProxyAccessType IEConfig
$certkey = ConvertTo-SecureString "<EnterCertificateKeyHere>" -AsPlainText -Force
Connect-ExchangeOnline -CertificateFilePath "pfx Certificate Path" -AppId <EnterAppIdHere> -Organization "domain.onmicrosoft.com" -CertificatePassword $certkey -PSSessionOption $sessopt -verbose
如果您使用

PSExec -i -s PowerShell
然后,您为用户输入的代理信息将无效,因为本地系统帐户将有自己的配置文件信息。此外,如果代理需要身份验证,您也不会提供任何网络凭据

如果您真的想在系统帐户下运行,您可以尝试使用netsh配置代理,但如果您的代理需要身份验证,这将不起作用。

如果您使用

PSExec -i -s PowerShell
然后,您为用户输入的代理信息将无效,因为本地系统帐户将有自己的配置文件信息。此外,如果代理需要身份验证,您也不会提供任何网络凭据


如果确实要在系统帐户下运行,可以尝试使用netsh配置代理,但如果代理需要身份验证,则无法运行。

使用netsh也会出现错误,但这次Exchange模块似乎没有从WinHttp中选择代理。使用netsh也会出现错误,但这次似乎是Exchange模块不从WinHttp中选择代理。