The problem somehow seems to lie specifically with Visualcron's internal Powershell host. If I change the settings on the task to tell it to run remotely, but on localhost (obviously, with powershell remoting enabled and an appropriate credential), it works. If I have the powershell script call powershell.exe and run the desired command, it appears to work. I have not yet tested using an Execute task to call powershell the same way, but I imagine that would likely also work. So does running it from my local machine or a remote session to the Visualcron host (so far I haven't seen the same error I previously got in ISE, but I also don't use ISE anymore and haven't tested it again).
For what I assume are reasons at least partly related to Visualcron's incomplete support for .Net Core, it only works in Windows Powershell and not in Powershell 7, but that's not really an issue for me.
It seems to work only with Load Profile unchecked on the credential (whereas calling the Powershell executable only works
with it checked), and still does not solve several of my use cases on its own, because most of my use-cases involve network shares, and remoting to the local machine introduces the well-known Powershell double-hop problem. By comparison, invoking powershell.exe doesn't introduce the double-hop problem, but it does make the task more awkward to maintain, especially ones where I would prefer to use parameters.
...I was about to close this message with the question of whether any of this helps identify the problem and if there might be a possible fix without having to wait for a release cycle, and then I was doing a last bit of poking around and noticed the copies of VisualCron.dll and VisualCronAPI.dll in the Powershell directory of the Visualcron installation, next to the TashPowerShell executables.
Remembering the issue some people had reported with needing to include CommClient.dll, CommClientCore.dll, and CommServer.dll in their .Net programs to use the API, I took a shot in the dark and tried copying those three DLLs into that Powershell directory...
And so far, it looks as if it's working, despite the fact that every combination I tried of setting the environment current directory to the VisualCron installation folder and trying to load those DLLs with Add-Type (to try to make sure the objects the provided were available) did not.
Interesting side note: It only works with Local Login+Load Profile, and is the first case I can
remember encountering where a specific combination of those checkboxes is needed
and I get different errors depending on which of the other two combinations I use. Neither checked results in the call to Connect() telling me the active directory user doesn't exist; Local Login but not Load Profile gives me two cryptic lines of "Access Denied."
Edited by user
5 years ago
|
Reason: Not specified