遇到的一个SCOM怪问题,虽然解决可是不知道为何

最近SCOM的主机升级OS到windows server 2012 r2 , 以前经过调用Powershell来使用webservice发送短信的脚本老是报错。web

PSMessageDetails : Exception : System.IO.FileNotFoundException: 未能加载文件或程序集“file:///C:\ Windows\TEMP\2alyptoa.dll”或它的某一个依赖项。系统找不到指定的文件。 文件名:“file:///C:\Windows\TEMP\2alyptoa.dll” 在 System.Reflection.RuntimeAssembly._nLoad(AssemblyN ame fileName, String codeBase, Evidence assemblySecurit y, RuntimeAssembly locationHint, StackCrawlMark& stackM ark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFoun d, Boolean forIntrospection, Boolean suppressSecurityCh ecks) 在 System.Reflection.RuntimeAssembly.InternalLoadAsse mblyName(AssemblyName assemblyRef, Evidence assemblySec urity, RuntimeAssembly reqAssembly, StackCrawlMark& sta ckMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotF ound, Boolean forIntrospection, Boolean suppressSecurit yChecks) 在 System.Reflection.Assembly.Load(AssemblyName assem blyRef, Evidence assemblySecurity) 在 System.CodeDom.Compiler.CompilerResults.get_Compil edAssembly() 在 Microsoft.PowerShell.Commands.NewWebServiceProxy.G enerateWebServiceProxyAssembly(String NameSpace, String ClassName) 在 Microsoft.PowerShell.Commands.NewWebServiceProxy.B eginProcessing() 在 System.Management.Automation.Cmdlet.DoBeginProcess ing() 在 System.Management.Automation.CommandProcessorBase. DoBegin() 警告: 程序集绑定日志记录被关闭。 要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!E nableLog] (DWORD)设置为 1。 注意: 会有一些与程序集绑定失败日志记录关联的性能损失。 要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLo g]。 TargetObject : CategoryInfo : NotSpecified: (:) [New-WebServiceProxy], FileNotFoundEx ception FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Co mmands.NewWebServiceProxy ErrorDetails : InvocationInfo : System.Management.Automation.InvocationInfo ScriptStackTrace : 在 send-smsMessage、C:\Scripts\SendSmsByAlertCustomSettin g.ps1 中: 第 98 行 在 、C:\Scripts\SendSmsByAlertCustomSetting. ps1 中: 第 127 行 PipelineIterationInfo : {} shell

这个错误和New-WebServiceProxy 有关系,关键是我登录SCOM的notification 帐号下,运行脚本测试,又不会报错。 windows

而后我修改了SCOM 的notification Account 为另一个帐号,而后重启了下SCOM主机,结果又不会报错了,惟一的不一样是新的这个帐号在administrators组,而以前的帐号只是一个普通的user. ide

找到不一样后,我把旧的SCOM nofication account 加入到administrators 组,重启SCOM 主机,而后测试了下告警短信,脚本执行也不报错。 性能

另外看了下c:\windows\TEMP\目录的权限,这个目录普通用户只能建立目录和文件,本身建立的文件才有权限,难道和这个有关系? 仔细思考下,以为也不该该,为什么没有加入administrators组时,手动执行脚本也不报错呢,恰恰由SCOM脚本订阅时执行命令就会报错。 测试

这个问题先放在这里,后续再看看…. 日志

相关文章
相关标签/搜索