About Terminal Server, Citrix, Delphi and other stuff
3 May
I needed to delete around 50 scheduled tasks from several machines in Altiris because something went wrong in on of the first jobs.
It would have better if the jobs were configured to fail on error and not continue but they weren’t.
Deleting the jobs from the Altiris console is very, very, slow. First the console asks for confirmation (after showing the hourglass for a long time):
Then the actual delete can take a few minutes and then the next server and so on.
I decided to delete the tasks directly from SQL.
I know this is not preferred but I think in the end it’s safe enough because I found a stored procedure called del_event_schedule which looks like this:
DELETE FROM event_schedule WHERE schedule_id = @schedule_id
IF (@@error != 0)
rollback transaction
else
commit transaction
So al it does is a (transacted) delete from the table.
29 Apr
I am currently deploying 64 Citrix XenApp servers with Altiris. The deployment consists of an OS Image, OS Configuration and finally Citrix XenApp and Applications.
In the OS Configuration part the IP configuration needs to be applied and I decided to do this with a database.
The database consists of 2 tables; one table with the per host settings and one table with the global settings (such as DNS).
In the Altiris job both tables are read from an embedded VBScript and assigned to the NIC.
Database configuration
I created a database (SQL Server) called IPManagement with 2 tables:
12 Dec
Last time I showed a User Defined Function to the Full Path of an Altiris Job given it’s id (event_id). Note that Altiris calls a Job an Event so the terms Event and Jobs are interchangeable here.
To complete it we first need to prepend the server and share name to the path.
I looked into the Altiris database tables to find the best place to get the servername and it seems that the hostname column of the mmsettings table is a good way.
In my database there was only one row in the table but I restrict the results by adding top 1:
Then I looked into the available tokens for one that returns a job id but we can only return a job name or a computer id. Since a job name is not unique I decided to use the computername and find the active job for this computer.
When a Job is scheduled an entry is added to the event_schedule table. If you look into this table you will notice a column status_code which is NULL initially and when the job start it will get a value of -1 which indicates the job is active.
When the job has finished the status will always be 0 or higher. (more…)
9 Dec
Earlier I described a SQL Query to get the Full Path of an Altiris Job, today I will describe how we can make a User Defined Function (UDF) in SQL so we can call it easier.
I am using an UDF because it allows us to specify parameters, in this case a single parameter (the EventId (or job id).
This is the SQL that creates the UDF:
– Recursive member definition
SELECT t2.folder_id,t2.name, t2.parent_id, Level+1
FROM event_folder AS t2, t1
WHERE t2.folder_id = t1.parent_id
)
– Statement that executes the CTE
– STUFF and FOR XML are used to Concatenate the Values and seperate them by \ character
SELECT @str = STUFF((SELECT ‘\’ + name from t1 order by level desc FOR XML PATH(‘‘)),1,1,’‘)
RETURN @str
END
GO
7 Dec
I wanted to query the full path name of an Altiris Job, this sounds easier that it is though.
Consider the following hierarchy:

Now I want to assemble the full Path, in this case: RPA\Getronics\PKG_p007.Citrix_Components.
23 Nov
I was playing around with the AxSched tool that comes with Altiris, in my case the version that comes with v6.9 build 453.
I could not make it connect to the Deployment Server from my test machine, it seemed like the /dsn parameter I used was totally ignored.
I also tried the /d and /db parameters but they didn’t have any effect at all, the message was always:
Error opening database connection:
SQL Server does not exist or access denied.
ConnectionOpen (Connect()).
So I opened AxSched in Ida Pro and set a Breakpoint to the place where the SQL Connection seems to be made:

Ida nicely hints us that the ConnectionString is in the ECX register so we only have to inspect it to see it’s value.
Actually AxSched does several attemps and the used Connection Strings are:
So I bypassed by adding a DSN with the name Altiris eXpress Database and then it works.
23 Nov
Earlier today I wrote about my Altiris Job Builder tool but when I tested the actual produced build job I noticed something weird: the job was scheduled but not executed.
I then tried to manually push a job to this server and that one executed fine.
When I clicked the Job I could see that it was scheduled:
But when I clicked the Server it wasn’t there:
23 Nov
I have created a little tool for myself that I have call Altiris Job Builder, it retreives the Jobs from the Altiris database and shows them in a Treeview.
Then I can assemble a Master Build Job by dragging the needed Jobs to another Treeview on the right. Since it’s just for me it doesn’t have a fancy gui:
So why did I write it? Well I have divided my Jobs into Prerequisites and Packages, for instance IIS and Terminal Server and Java are prereqisuites for Citrix. But many prereqisuites are required for one or more other packages, eg Java is also used for certain applications. (more…)
26 Oct
I was trying to install HP Insight Control server deployment (previously called HP Rapid Deployment Pack) on Sql Server 2008 Express. I will just call it Deployment Server or DS from here.
I first installed SQL 2008 Express with Advanced Services and configured it to listen op Port 1433 as required by DS.
The installation of the first part (Deployment Server version 6.9.4) indicated a successfull install but the prereqisuites check of the Hotfix version 2.0 installer failed on the last step:
This was strange because I didn’t yet startup the console, so I decided to start it and close it as this would perhaps allow me to continue.
The next screen was a clear indication something went wrong:

I presumed that the ODBC connection was missing so I went to Adminstrative Tools | Data Sources (ODBC). But the ODBC connection was present. I then fired up SQL Server Management Studio which showed me the eXpress database was missing.
(more…)
28 Oct
Script to clear SQL Transactions Logs
Did you know that when you backup a SQL database with Backup Exec (with the SQL Agent) the transaction log is not cleared? This means that if you use the full recovery model your transaction log keeps growing and growing. I tested this with Backup Exec v11D and you can only create a seperate scheduled job to backup the transactions logs but not one to just clear it or truncate it after successfull backup.
Therefore I made a VBS script that clears SQL transactions logs, an option would be to schedule this as a post backup job.
This is the script:
Active Directory Altiris bug Citrix Dell Delphi Exchange Exchange2003 Exchange2010 Hewlett-Packard HP iOS Jailbreak Java LinkedIn Linux MSI MySQL Navigation Objects Office Outlook Passat PowerPoint PowerShell referall was returned RNS315 RNS510 SasLibEx script slow Terminal Server ThinApp TSAdmin TSAdminEx VBS VCDS Vista VMWare Volkswagen Windows PE WLAN Wordpress WTSWaitSystemEvent wts_event_flush
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.