遇到的一个SCOM怪问题,虽然解决但是不知道为什么

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

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 : {}

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

然后我修改了SCOM 的notification Account 为另外一个账号,然后重启了下SCOM主机,结果又不会报错了,唯一的不同是新的这个账号在administrators组,而之前的账号只是一个普通的user.

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

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

这个问题先放在这里,后续再看看….                       本文转自 yoke88 51CTO博客,原文链接:http://blog.51cto.com/yoke88/1950524

上一篇:CentOS7 网卡命名


下一篇:Apache+varnish(高性能开源HTTP加速器)搭建负载均衡集群