Archive for the 'design' Category


when 3.5 isnt good enough

I like new functions in framework but every new version has SOMETHING thats missing where I need most.

.net 3.5 came out with nice/better wrapper for the AD modification, yet it didnt give me the function to modify all the properties especially the tsprofilepath.

well I’ve found the alternative but you need to import DLL(Interop.TSUSEREXLIB.DLL) from here

then use the code below

using TSUSEREXLib;
using System.DirectoryServices;
using System;
using System.Collections.Generic;
using System.Text;

namespace Set_Terminal_Service_Properties
class Program
static void Main(string[] args)
string acctName = “chrisca”;
string tsHomeDrive = “H:”;
string tsHomeDirectory = “\\\\servername\\tshomedirectory\\”;
string tsProfilePath = “\\\\servername\\tsprofilepath\\”;
int enableLogon = 1; // enable terminal service logins

DirectoryEntry entry = new DirectoryEntry
(“LDAP://CN=Chris Calderon,CN=Users,DC=corp,DC=contoso,DC=com”);
ADsTSUserEx oUser = (ADsTSUserEx)entry.NativeObject;
oUser.AllowLogon = enableLogon;
oUser.TerminalServicesHomeDirectory = tsHomeDirectory + acctName;
oUser.TerminalServicesHomeDrive = tsHomeDrive;
oUser.TerminalServicesProfilePath = tsProfilePath + acctName;

Alternatively, my code looks like below (need reference to System.DirectoryServices.AccountManagement in .net 3.5)

var context = new PrincipalContext(ContextType.Domain);
var user = UserPrincipal.FindByIdentity(context, IdentityType.SamAccountName, UserNameBox.Text);
Debug.WriteLine(“UserNameBox” + UserNameBox.Text);
ResultBox.Text = ResultBox.Text + Environment.NewLine + “ScriptPath ” + user.ScriptPath;
Debug.WriteLine(“user.GetGroups().Count()” + user.GetGroups().Count());
Debug.WriteLine(“user” + user.DistinguishedName);
foreach (GroupPrincipal group in user.GetGroups())
ResultBox.Text = ResultBox.Text + Environment.NewLine + group.SamAccountName;
DirectoryEntry de = new DirectoryEntry(“LDAP://”+user.DistinguishedName);

ADsTSUserEx tsu = (ADsTSUserEx)de.NativeObject;
Debug.WriteLine(“tspath” + tsu.TerminalServicesHomeDirectory );

Well using Interop will be messy but I think its better than writing process execute code to start vbs. (Alternative method is to use invokeSet, but I could not find better example so I’ve passed using it.)

Above original Code is refered from here


operation timed out but you cant do anything!

I mean… shouldnt program give OPTIONs when operation failed? or if there are some previous task?
This is about VMware, Virtual Infrastructure for ESX..

I have asked my colleague to take snapshot the server then install the .net framework 3.5 on a corporate web server.
Shutdown the server, take the snapshot, start the server, and install, reboot.

All should be 5min task.


snapshot has failed and miserably we have spent more than an hour trying to recover stuck server to start up. I knew immediatly that vm task or vmserver pid requires to be KILLED on the ESX but since my colleage was more GUI guy than CLI he never thought we requires to logon to ESX via CLI and issue KILL command.

Ok.. I like GUI, I do, but when CLI provides more options (in fact REQUIRED operation in this case) but GUI doesnt, I must say that GUI sux.

I think VI should

1 list all queued task
2 list all process that can be killed
3 provide all command wrapper (instead of cancel option thats greyed out..)

I know.. im asking too much…
I’ll keep using putty for now..

for others who may have suffered same issue and think you need to manually KILL the virtual guest machine, read this


ICM nightmare

It must be just me or canon printer ICM is getting out of control ? (PIXMA MP800)
I let printer driver (I use Vista x64 and XP SP2 ) to handle the colour matching and I get awful washed out colours.
I let software (light room 2 in this case) and I get sort of OK colour but its still not perfect.

several users post their concern on the canon printers ICM but oh well I’d say it’s a bit to late for me now.

Lastly, how come there is no explanation of ICM files in Canon web sites??


Some Tips of ICM for canon

PR – Pro Paper
MP – Matt Paper
SP – Photo Paper (Super Photo Paper)
Numbers 1 to 5 (1 as high quality – 5 as high speed)



Interesting post about how online game DB design is completely different to other business application designs.

Do not trust client, Do not place data on client (any data will be and can be used for cheat)

rather interesting concept and raises interesting point how other field sees the server-client model with completely different views.

Usually you design as such that DB access is distributed and access less (cache on memory or on client side) but how would you handle it if every data has to be on the server end ?


ok, time to buy more server…

We are over loaded! Need more POWER!

Being citrix engineer I have one less worry, that is scalability. or provide so-called POWER on the fly.
These days, if you havn’t noticed Citrix is all about providing server on the fly.
Using XenServer, XenApp and Provision server and pump in the new server on the fly as required.

Or even manually, just build the server and put them on the farm. bang you got more power. (as long as you have space/hardware to put them but thats completely different topic of its own)

Ok, topic isnt about Citrix, its about Database.

Shit happens everyday in BACKEND world and one of the damn query is all about

my F***ing app is slow!! do something! or else!

Yes… sad fact is that lot of times, your Citrix server is performing just fine, or UNDER performing for some case and finger gets pointed at backend database. Now it gets ugly and become finger point excersice

God send! I just stumped on software called memcached which scales your database cache(read only) to distributed servers sitting in the datacenter (or your comms room)

Well only problem I can see is that it requires initial design change to implement properly but damn it scales so well that I think CLUSTERED bloddy over priced M$ SQL or ORACLE or DB2 has gets kick at the back.

I didnt know thats possible! or M$ SQL offers distributed DB!

well Im not trying to convince MS evangelist (dont get me wrong, 99 out of 100 MS SQL runs just fine) or trying to tell others to stay away from MS SQL in intial design but please can someone THING other posibility before the damn implementation when DB needs to be scaled?

Here is another example, not recently but close enough, my employer has decided to invest big buck and implement ITIL compliant management system (I wont name the product…) System does incident management, change management, problem management, config management, etc,etc

Looks great on the book but when hundreads of users were hitting the DB, it corrapsed in the initial run due to over loaded backend.

Hey I work in “INCIDENT” world, I cant follow up the incident when the system is down even it is SEVERITY 1.
Vendor who designed the system, project team who implemented the system, even admins who runs it never thought it would be this bad. (well may be they did but I dare not to ask them as I know answer would be this thing is shit and we should be running away from it)

Problem was like DB has no ability to scale, and in the end, customer accounts had to devided in to multiple DB instances that forces people to login to multiple systems.

Well I bet it costs more as more DB licenses , more OS, more storage, more backup and more DAMN MANAGEMENT costs. And lost of productivity due to login on to multiple system to track incidents. Priceless.

What a waste of money.

and what I heard from management? it was a great implementation. Well I dont need to tell you I eventually quit the job.

January 2019
« Jan    

Greyeye Tweets