我不明白我得到的NewNotImplementedException运行时错误

 田得婕_762 发布于 2023-02-05 13:11

我正在尝试实现一个远程运行空间,它需要connectionInfo与Exchange通信,导入模块需要与活动目录通信.这是问题代码:

runspace = System.Management.Automation.Runspaces.RunspaceFactory.
CreateRunspace(psConnectionInfo);
runspace.InitialSessionState.ImportPSModule(new[] { "ActiveDirectory" });
runspace.Open();

我得到的运行时错误是:

无法执行操作,因为操作"文件中的偏移32处的NewNotImplementedException:line:column:0:0"未实现

如果我省略该runspaceInitialSessionState行,则不会收到错误但是SetADServerSettingsViewEntireForest 的PowerShell命令无法运行,因为它无法识别.

堆栈跟踪:

无法执行操作,因为未实现操作"文件中的偏移32处的NewNotImplementedException:line:column:0:0".在System.Management.Automation.RemoteRunspace.get_InitialSessionState()位于c:\ Users\rtanner.CATNET\Documents\Visual Studio 2013\Projects\ManageUserForwardsWS\ManageUserForwardsWS\ManageUserForwards.asmx中的ManageUserForwardsWS.ManageUserForwards.SetExchangeCredentials(String userName,String PwString) .cs:第122行

我也可以使用此代码生成相同的错误:

        Pipeline pipeline = runspace.CreatePipeline();

        PowerShell powershell = PowerShell.Create();
        powershell.Runspace = pipeline.Runspace;

        powershell.Runspace.InitialSessionState.ImportPSModule(new[] { "ActiveDirectory" });

这是StackTrace:

无法执行操作,因为未实现操作"文件中的偏移32处的NewNotImplementedException:line:column:0:0".在System.Management.Automation.RemoteRunspace.get_InitialSessionState()位于c:\ Users\rtanner.CATNET\Documents\Visual Studio 2013\Projects\ManageUserForwardsWS\ManageUserForwardsWS\ManageUserForwards.asmx中的ManageUserForwardsWS.ManageUserForwards.SetForward(String sAMAccountName,String fowardAddress) .cs:第151行

这个附加信息有帮助吗?有想法该怎么解决这个吗?

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有