Host OS is Windows Server 2012 R2 Standard.
I upgraded this morning from 8.4.1 to 8.5.5 and now, even after trying a restart and a reboot, I have multiple tasks that had previously been working fine for accessing the Visualcron API from Powershell (for a long time - I am using the same technique with a 6.2.2 server) that are now returning the following error:
Exception calling "Connect" with "2" argument(s): "Method not found: 'Void CommClientCore.Messages.Message.set_Content(VisualCron.MessageClass)'."
I do not get this error when running the same code in Powershell ISE on the same server as the same user.
This is the "powershell script text" from a sample task that is failing. It fails the same way whether the credential used is set to local login, local login/load profile, or neither; and whether executing in x86 mode or not.
Edit: I have also now gotten the same error providing the script as a file instead of as script text.
Extended debug logging doesn't tell me anything the error output didn't.
I do not know if this may be related: when I run the code below in Powershell ISE, it connects and executes successfully, but the
first time it is run, I get an error as follows:
add-type : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
At line:2 char:1
+ add-type -Path "c:\Program Files (x86)\VisualCron\VisualCronAPI.dll"
The LoaderExceptions are:
Could not load file or assembly 'Microsoft.Win32.TaskScheduler, Version=2.8.10.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233' or one of its
dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Win32.TaskScheduler, Version=2.8.10.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233' or one of its
dependencies. The system cannot find the file specified.
Searching for relevant information led me to
this thread.
However, since in ISE the code still works, it seems to me that even if the assembly error is happening and is the underlying cause, the error message implies a problem in the
handling of that error.
I'm stumped. I will probably have to roll back by end of day if there isn't some other solution.
add-type -Path "c:\Program Files (x86)\VisualCron\VisualCron.dll"
add-type -Path "c:\Program Files (x86)\VisualCron\VisualCronAPI.dll"
$c = new-object VisualCronAPI.Client
$conn = new-object VisualCronAPI.Connection
$conn.Address = "LOCALHOST"
$conn.UseADLogon = $true
$s = $c.Connect($conn,$true)
$j = $s.Jobs.GetAll() | ?{!($_.Stats.Active) -and $_.Group -notmatch "^[_ι]" } | select-object Id,@{l="NextRun";e={$_.Stats.DateNextExecution }},Group,Name | sort-object NextRun,Group,Name
$c.Disconnect($s) | out-null
$j
Of course, please go ahead and move this to the API forum if it would be more appropriate there. The reason I put it in General Problem Solving was because using the API in this manner seems to be working if it isn't done from a Visualcron Powershell task.
Edited by user
2019-09-09T21:14:52Z
|
Reason: notes on calling script and on forum selection