天天看點

遇到的一個SCOM怪問題,雖然解決但是不知道為什麼

最近SCOM的主機更新OS到windows server 2012 r2 , 之前通過調用Powershell來使用webservice發送短信的腳本總是報錯。

<code>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&amp; 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&amp; 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 行 在</code>

<code></code>