Re: Intermittent "Access is denied" when opening session with no session log created
Thanks Martin. The issue was indeed related to AV (Symantec Endpoint Protection in this case).
WinSCP.exe
by the WinSCP .NET assembly.
$fnSession.SessionLogPath
).
Exception : System.Management.Automation.MethodInvocationException:
Exception calling "Open" with "1" argument(s):
"Access is denied" --->
System.ComponentModel.Win32Exception: Access is denied
at System.Diagnostics.Process.StartWithCreateProcess
(ProcessStartInfo startInfo)
at WinSCP.ExeSessionProcess.InitializeChild()
at WinSCP.ExeSessionProcess.Start()
at WinSCP.Session.Open(SessionOptions
sessionOptions)
at CallSite.Target(Closure , CallSite , Object ,
Object )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps
.CheckActionPreference(FunctionContext funcContext,
Exception exception)
at System.Management.Automation.Interpreter.ActionCa
llInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTry
CatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTry
CatchFinallyInstruction.Run(InterpretedFrame frame)
TargetObject :
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : Win32Exception
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at SFTPSessionOpen, file_mover_6.ps1: line 388
at <ScriptBlock>, file_mover_6.ps1: line 1023
PipelineIterationInfo : {}
PSMessageDetails :
WinSCP Version 5.17.9 (Build 10905) (OS 6.3.9600 - Windows Server 2012 R2 Datacenter)
Command-line: ".\winscp.exe" /xmllog="C:\Users\.\AppData\Local\Temp\wscp0680.0074F6C7.tmp" /xmlgroups /xmllogrequired /nointeractiveinput /dotnet=5.17.9 /ini=nul /log=".\File_Mover_6\Logs\.\WinSCPSessionLogs\WinSCPSession.log" /rawconfig Interface\TryFtpWhenSshFails="0" /console /consoleinstance=_1664_15182554_726