Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline Eddie Kumar  
#1 Posted : Monday, January 8, 2018 11:35:15 AM(UTC)
Eddie Kumar

Rank: No customer

Joined: 11/23/2017(UTC)
Posts: 14
United Kingdom
Location: England, Worthing

Thanks: 12 times
Was thanked: 1 time(s) in 1 post(s)
Hi,

Where can we quickly get the list of Task-IDs? Without having to navigate through each tasks in the Variables window (in the Global Variables (window) -> VisualCorn variables -> Jobs -> Active jobs -> Tasks -> JobId --- this is very time taking).

Basically, we have a long job that contains many tasks (more than 50 tasks), we needed to clone it (to achieve similar functionality), there are lots of tasks that refer to other tasks (in the same job) using absolute reference i.e. using the Task-ids GUIDs (instead of using relative references such as Next/PrevTask etc.)

Problem:
After cloning the job, the tasks in the new cloned copy hold the old task-ids (i.e. point/refer to the tasks in the old job that require manual fixing), what we need is list of task-ids (of the tasks) in both the old & new jobs, so that we can replace the old task-ids with the new ones (by doing a side-by-side comparison).

Therefore wondering if there is a way to derive the list of Task-IDs of ALL tasks in a job?
Also is task-id available anywhere in the "Edit Task" window (without having to open the Variable window)?

TIA

Edited by moderator Friday, January 19, 2018 4:20:03 PM(UTC)  | Reason: Not specified

Offline ErikC  
#2 Posted : Tuesday, January 9, 2018 9:28:07 AM(UTC)
ErikC

Rank: Paid support

Joined: 2/26/2008(UTC)
Posts: 1,520
Netherlands
Location: Amsterdam

Thanks: 114 times
Was thanked: 220 time(s) in 188 post(s)
Hi Eddie,

I'll move this to the API section of the forum, that's the way to go here I believe.
What you can do is use this Powershell script I made. Just make a Powershell task and add two parameters to it.
Name them VCpath and VCAPIpath and add the full path to both dll's in your visualcron install folder (visualcron.dll + visualcronapi.dll).
You can change the connection settings in the script.

The output will be: jobname;taskname;taskid

Good luck!

Regards,
Erik

Code:
Param(
	[string] $VCpath,
	[string] $VCAPIpath
)
  
# Load the VisualCron API Dlls
$VC = [Reflection.Assembly]::LoadFrom($VCpath);
$VCAPI = [Reflection.Assembly]::LoadFrom($VCAPIpath);

# Define Client & Server Objects
$Global:Client = New-Object -TypeName VisualCronAPI.Client
$Global:Server = New-Object -TypeName VisualCronAPI.Server

# Define Connection Object
$Conn = New-Object -TypeName VisualCronAPI.Connection

# Set Connection Values
$Conn.Address = 'localhost'
$Conn.UserName = 'admin'
$Conn.PassWord = ''
$Conn.Port = 16444
$Conn.ConnectionType = 'Local'

# If connecting to localhost, check VisualCron Service is running (useful for cluster installations)
If ($Conn.Address -like 'localhost' -and -not (Get-Process VisualCronService -ErrorAction SilentlyContinue)) {
	Write-Output "2 VisualCron ExecTime=0 Error: VisualCron service not running"
	exit
}

# Try to Connect to the VisualCron Server
try {
	$Global:Server = $Client.Connect($conn, $true);
}
catch {
	Write-Output "2 VisualCron ExecTime=0 Error: Could Not Connect to VisualCron Server"
}

# Get the jobs
$jobs = $Global:Server.jobs.GetAll()

# Run through them 
foreach ($job in $jobs) {
	# Run through all the tasks
	foreach($task in $job.Tasks)
	{
		Write-Output ($job.Name +";"+$task.Name+";"+$task.Id )
	}
}
Uses Visualcron since 2006.
thanks 1 user thanked ErikC for this useful post.
Eddie Kumar on 2/21/2019(UTC)
Offline bweston  
#3 Posted : Tuesday, January 16, 2018 6:19:00 PM(UTC)
bweston

Rank: Paid support

Joined: 12/14/2012(UTC)
Posts: 78

Thanks: 2 times
Was thanked: 16 time(s) in 13 post(s)
Also potentially useful: in 8.2.9, at least, at the bottom left of any job or task edit window, I see "Copy Job Id" or "Copy Task Id" which puts the ID on the clipboard.

<silly>I have not found a way to copy the job's or task's ego or superego directly to the clipboard.</silly>
thanks 1 user thanked bweston for this useful post.
Support on 1/19/2018(UTC)
Offline Eddie Kumar  
#4 Posted : Thursday, April 18, 2019 4:38:33 PM(UTC)
Eddie Kumar

Rank: No customer

Joined: 11/23/2017(UTC)
Posts: 14
United Kingdom
Location: England, Worthing

Thanks: 12 times
Was thanked: 1 time(s) in 1 post(s)
Hi Erik,

Thanks for your time, sorry I couldn't come back to this earlier, I created the PowerShell task along with the suggested Parameters, however I'm getting "Access Denied" although I have admin access level. This is perhaps due to the fact that I authenticate using ActiveDirectory (without password), so how can I used the " Integrated Security=true" please instead of "$Conn.PassWord=" .

TIA
Eddie

Edited by user Thursday, April 18, 2019 4:39:09 PM(UTC)  | Reason: Not specified

Offline bweston  
#5 Posted : Thursday, April 18, 2019 4:42:16 PM(UTC)
bweston

Rank: Paid support

Joined: 12/14/2012(UTC)
Posts: 78

Thanks: 2 times
Was thanked: 16 time(s) in 13 post(s)
Originally Posted by: Eddie Kumar Go to Quoted Post
Hi Erik,

Thanks for your time, sorry I couldn't come back to this earlier, I created the PowerShell task along with the suggested Parameters, however I'm getting "Access Denied" although I have admin access level. This is perhaps due to the fact that I authenticate using ActiveDirectory (without password), so how can I used the " Integrated Security=true" please instead of "$Conn.PassWord=" .

TIA
Eddie


Code:
$conn.UseADLogon = $true
instead of username and password, but then you need to run using the credential of a user with Visualcron access.
thanks 2 users thanked bweston for this useful post.
Support on 4/23/2019(UTC), Eddie Kumar on 8/21/2019(UTC)
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top