我正在尝试建立PowerShell会话以对localhost上的Exchange服务器运行多个Exchange命令.我一直收到以下错误:
New-PSSession : [<HOSTNAME>] Connecting to remote server <HOSTNAME> failed with the following error message
: Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:12
+ $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'h ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
Run Code Online (Sandbox Code Playgroud)
我的代码是Microsoft Technet文章的副本粘贴.它适用于远程机器,但无论何时我瞄准我运行的机器,我都会收到上述错误.
到目前为止我尝试过的:
about_remote_troubleshooting
帮助主题.与Access Denied错误相关的任何内容均无效.net use
并net session
确保我没有具有相同凭据问题的奇怪的多个连接.(我没有看到任何迹象表明)一些快速说明:
powershell access-denied powershell-remoting windows-server-2012 exchange-server-2013
我在Exchange Server 2013中使用EWS加载MimeContent属性时遇到问题。这是我的工作:
var propertySet = new PropertySet{
ItemSchema.Subject,
ItemSchema.TextBody,
ItemSchema.DateTimeCreated,
ItemSchema.LastModifiedTime
};
var item = Item.Bind(mailbox.ExchangeServiceInstance, itemId, propertySet);
Run Code Online (Sandbox Code Playgroud)
邮箱,权限,PullSubscription和ExchangeService已设置并且可以正常使用,“ itemId”是正确的,现有的。该代码有效,我可以访问已加载的属性。
但是当我尝试紧随其后加载MimeContent时,出现错误:
var binaries = new PropertySet(BasePropertySet.IdOnly, ItemSchema.MimeContent);
item.Load(binaries);
Run Code Online (Sandbox Code Playgroud)
我得到的异常是:
Microsoft.Exchange.WebServices.dll中发生“ Microsoft.Exchange.WebServices.Data.ServiceResponseException”
缺少参考时间段。
我无法在Google上找到与EWS相关的此异常的任何类似问题,或在加载MimeContent时遇到的任何类似问题。我一直想自己弄清楚,但是谁能给我提示在哪里挖的提示?
c# exchange-server exchangewebservices ews-managed-api exchange-server-2013