This topic contains 4 replies, has 3 voices, and was last updated by
July 7, 2015 at 1:49 pm #27283
I am trying to execute a native ( db2 ) command on couple of remote servers.
The actual command is "db2diag -A"
When I execute the command from remote desktop the command runs successful.
But when I run it via script block on Invoke-Command or PSSession, the tool ends without any error or warnings.
I was able to confirm that the native command is invoked using process monitor. I have been able to successfully execute other utilities from DB2 but not this one.
I read the gotchas on certain functions that depend on user profile not being available in remoting, but I am hoping that is not the case here, considering the tool is just rotating the logs.
Any suggestions on how to diagnose this further or resolve this issue?
Appreciate your support
July 7, 2015 at 1:58 pm #27284KeymasterPoints: 1,811Rank: Community Hero
Unfortunately, there might not be a satisfactory resolution.
It's possible that the tool requires a full user profile, which Remoting doesn't provide.
It's also possible that the tool isn't using stdin/stdout, which means it's running, but you have no way to interact with it.
Neither of those can be resolved without rewriting the tool, but one of those is a likely cause. PowerShell can only do so much when it comes to external commands.
July 7, 2015 at 2:13 pm #27285
Thank you Don for your thoughts. I will follow-up with the vendor on this.
Would you have any pointers to resources on this – to determine if the executable indeed requires a full user logon session or any diagnostic tools that might provide additional insight? I understand this could be out of scope, just checking.
July 7, 2015 at 2:31 pm #27286KeymasterPoints: 1,811Rank: Community Hero
There's no way to tell without looking at its source code, really.
July 11, 2015 at 1:10 am #27416ParticipantPoints: 60Rank: Member
Just out of interest, how are you running the executable via PowerShell? Also, are you referring to the absolute path when running the executable, changing to it's location first, or is it pathed?
The topic ‘Issue with executing native executable remotely’ is closed to new replies.